Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Unable to Undo or Rollback Main Form and Subform Changes


View products that this article applies to.

Symptoms

When you make editing changes to a main form record and one or more subform records, and then click Undo Saved Record on the Edit menu, Microsoft Access does not undo changes that you made to the main form and the subform together.

If focus is in the main form, Undo Saved Record will undo changes to the main form record only. If focus is in the subform, Undo Saved Record will undo the changes that you made to the last record, but not to other records that you may have edited in the subform.

↑ Back to the top


Cause

Because Access does not group edits made to the main form record and edits made to one or more subform records in a single transaction, Access cannot roll back the changes as a single unit.

↑ Back to the top


Resolution

To work around to this behavior, you may find the technique demonstrated in the sample file, FrmSmp00.mdb useful. For information on how to obtain FrmSmp00.exe, please see the following article in the Microsoft Knowledge Base:
233324 Microsoft Access 2000 Sample Forms Database Available in Download Center

↑ Back to the top


More information

Microsoft Access maintains editing changes that you make to a single record in a form in a transaction independent of changes that you make to other records in the same form or in other forms, including subforms. When you choose to undo a record, Microsoft Access rolls back the transaction only for that singular record in the form.

This behavior extends to subforms. Microsoft Access maintains editing changes for a subform record in one transaction independent of record edits you make to other subform records in the same form or in another form, including the main form.

Because of the way that Microsoft Access maintains editing changes, it is not possible to group editing changes that you make to a main form and subform records in a single transaction. You cannot use the BeginTrans, CommitTrans, and Rollback statements or methods for this purpose. Microsoft Access controls all transaction processing for a form in a separate workspace independent of the workspace that these actions and methods could be invoked in, and Microsoft Access does not expose this separate workspace.

Steps to Reproduce Behavior

  1. Open the sample database Northwind.mdb.
  2. Open the Categories form in Form view.
  3. In the CategoryName field, change the category from Beverages to Super Beverages.
  4. Under Product Name in the subform, change the first record's name from Chai to Tasty Chai.
  5. Click the CategoryName field on the main form, and on the Edit menu, click Undo Saved Record. Note that in the main form Super Beverages returns to Beverages, but that in the subform Tasty Chai remains Tasty Chai.
  6. Click the first record in the subform, and on the Edit menu, click Undo Saved Record. Note that Tasty Chai returns to Chai.

↑ Back to the top


Keywords: KB208833, kbusage, kbprb

↑ Back to the top

Article Info
Article ID : 208833
Revision : 2
Created on : 6/28/2004
Published on : 6/28/2004
Exists online : False
Views : 334