logo
search
Document Editing Problems

How to Undo Form and Subform Changes in Microsoft Access

Algirdas JasaitisAlgirdas Jasaitis Oct 10, 2026 869 views

Question details

The user needs a reliable method to undo or cancel edits made in Microsoft Access forms and subforms, especially to prevent parent records from saving automatically.

How to Undo Form and Subform Changes in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
A user is entering or editing data in a database using bound forms that contain subforms.
Observed behavior
When the user clicks or navigates into a subform, Access automatically saves the parent form's record, making standard cancellation or undo commands ineffective for the main record.
Before you start

Verify whether your main form and subform are currently bound directly to a table (via the Record Source property), as this underlying architecture determines how Access triggers automatic saving events.

Solution 1Recommended

Use Me.Undo for the Current Form Record

The simplest built-in command to revert changes in the active form before the record is saved or focus shifts to a subform.

Access automatically saves the main record when your cursor moves to a subform. The Me.Undo command works perfectly for discarding uncommitted edits in the active form, but it cannot roll back parent records once the focus has transitioned.

1
Add a Command Button

Open your main form or subform in Design View and add a Command Button from the Form Design controls.

2
Assign the Undo VBA Command

Open the Property Sheet for the button, go to the Event tab, click 'On Click', select Code Builder, and type 'Me.Undo' into the VBA window.

3
Test the Cancel Logic

Switch to Form View, make an edit in a field without moving to the subform, and click the button to verify the changes are reverted.

Use Me.Undo for the Current Form Record
Focus Limitation: This command only applies to the active record. If the parent record was already saved by entering the subform, clicking an undo button inside the subform will only revert the subform's current data.
Free Microsoft Office alternative

Looking for a Free, Lightweight Office Suite?

While Microsoft Access handles complex database management, WPS Office provides a lightweight, highly compatible alternative for your everyday document, spreadsheet, and presentation needs. Enjoy seamless file compatibility and a familiar interface without subscription fees.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Install the Suite: Follow the simple on-screen prompts to install WPS Writer, Spreadsheet, Presentation, and PDF on your device.
  3. 3. Open Your Files: Launch WPS Office and directly open your existing Microsoft Office files to continue working seamlessly.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Familiar, tabbed user interface that requires zero learning curve.Lightweight installation that runs smoothly on all devices without slowing down your system.Built-in robust PDF editing tools for comprehensive document management.
QA img-9

Frequently Asked Questions

Why does my main form save automatically when clicking into a subform?

In Microsoft Access, a subform is treated as a separate object. When focus leaves the main form to enter the subform, Access assumes you have finished editing the main parent record and automatically commits (saves) it to the database to maintain referential integrity.

Can I hide subform controls to prevent premature saving in Access?

Yes. You can set the 'Visible' property of the subform control to False during initial data entry. Once the user clicks a specific 'Save Main Record' button, you can use VBA to make the subform visible for detail entry, preventing the automatic save sequence from triggering too early.

Does pressing the ESC key undo subform edits?

Pressing ESC once undoes changes in the currently active field, and pressing it twice undoes changes for the active record. However, if focus has already shifted between the main form and subform, the ESC key will only affect the current subform record and will not roll back the previously saved parent record.