简体   繁体   中英

Access Subform of Subform Not Saving When Navigating to New Fields

I have a SQL Server database that is linked to Access via ODBC. I have an MS Access subform (of a subform) that is not saving in certain circumstances.

In addition to the main form, I have a subform of the main form (call it Subform1). I also have a subform of Subform1 (call it Subform2). The mainform has a one-to-main relationship with Subform1. Subform1 has a one-to-many relationship with Subform2. Everything is based on tables (no queries). Every table is linked correctly (I think).

Everything works fine when there is only one record in Subform1: all tables save correctly, including the table linked to Subform2.

However, when I add a second record for Subform1, I lose all information in Subform2. I've done a lot of research but still can't find a solution. 1) The most common answer I see if making sure the tables are linked correctly, I believe I'm doing this correctly, especially since everything works if there is only one entry for Subformn1. 2) I've also read things about the subform "losing focus" which is not a concept I'm very familiar with and could not find a solution that worked. If this seems likely, it's very probable that I'm missing something very basic.

Thanks for any help!

在此处输入图像描述

I figured out what was happening. The datasheet subform (Subform2) was set to Data Entry = Yes. So everytime I was navigate to/from the subform, it would load a fresh datasheet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM