ACC: Main Form Record Edits Saved When Subform Gets Focus (132033)
The information in this article applies to:
- Microsoft Access 1.0
- Microsoft Access 1.1
- Microsoft Access 2.0
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q132033 Novice: Requires knowledge of the user interface on single-user computers.
SYMPTOMS
When you navigate to a subform control, edits you make to a main form
record are automatically saved. Validation rules for the main form record
are evaluated and the BeforeUpdate and AfterUpdate events run.
CAUSE
If Microsoft Access did not save the main form record, it would be possible
to create detail records that do not have a corresponding parent (main
form) record. Creating detail records without a corresponding main form
record would violate referential integrity rules.
For example, in the sample database Northwind.mdb (or NWIND.MDB in versions
1.x and 2.0), in the Orders form containing an order detail subform (the
Orders Subform form) linked on a common Order ID field, if Microsoft Access
did not save the main form Orders record immediately, it would be possible
to create order detail records that are saved with an Order ID number for
an order record that does not yet exist in the Orders table. If a problem
were to occur and the main form order record could not be saved, there
would be "dangling" order detail records in your database.
STATUS
This behavior is by design.
REFERENCES
For more information about referential integrity, search the Help Index
for "referential integrity," or ask the Microsoft Access 97 Office
Assistant.
For more information about BeginTrans, CommitTrans, and Rollback methods,
search the Help Index for "BeginTrans."
Modification Type: | Major | Last Reviewed: | 5/7/2003 |
---|
Keywords: | kbprb kbusage KB132033 |
---|
|