Others

How to Undo Changes Across Microsoft Access Subforms

Amos GikundaAmos Gikunda Oct 29, 2026 868 views

Question details

The user needs a single reset or undo action that applies to a main Microsoft Access form and its multiple subforms simultaneously.

How to Undo Changes Across Microsoft Access Subforms
Product
Microsoft Access
Device & OS
not provided
Scenario
Creating a multi-form data entry interface where non-technical users can safely cancel all form and subform changes at once via a single button.
Observed behavior
Looking for a reliable way to implement a global undo without keeping a database transaction open for the entire form session, which causes locking issues.
Before you start

Before implementing a global undo function, ensure your database architecture is finalized, as changing table structures later will require updating your temporary backup tables or VBA code.

Solution 1Recommended

Use Temporary Tables or Mirror Values to Store Initial Data

The safest and most reliable way to handle global undos across subforms without locking the database in a multi-user environment.

Keeping a database transaction open for the duration of a form session is heavily discouraged. Long-running transactions place severe locks on records and tables, making them highly unsuitable for multi-user applications.

Instead, saving initial values into a temporary mirror structure when the form opens allows you to easily restore them if the user chooses to cancel their edits.

1
Create a temporary table

Design a local, temporary table in your front-end database that exactly mirrors the structure of your main form and subform data sources.

2
Capture data on form load

Write a VBA procedure attached to the main form's 'On Load' event. This script should copy the current record's initial data into your temporary table.

3
Create a global Undo button

Add a single 'Reset' or 'Undo' button to your main form's interface to serve as the global cancel action.

4
Restore values on click

Attach a VBA script to the button's 'On Click' event. This script must delete the modified records, copy the original data from the temporary table back into the live tables, and refresh the form using 'Me.Requery'.

Use Temporary Tables or Mirror Values to Store Initial Data
Multi-User Friendly: This approach ensures that records are only locked for milliseconds during the actual save or restore process, completely avoiding database freezing issues for other users.
Free Microsoft Office alternative

Manage Your Data Easily with WPS Office

While Microsoft Access is a specialized database tool, many complex data management, entry, and reporting tasks can be handled more seamlessly using advanced spreadsheets. WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Office, featuring robust spreadsheet capabilities for tracking and analyzing data without the hassle of VBA programming.

  1. 1. Visit the WPS Office website: Go to the official WPS Office website from your preferred web browser.
  2. 2. Download the installer: Click on the 'Free Download' button to get the latest version of WPS Office.
  3. 3. Install and launch: Run the installer, follow the on-screen prompts, and start managing your data efficiently.
Fully compatible with Microsoft Excel (.xlsx, .xls) and Word formats.Lightweight design ensures fast loading and smooth performance on any device.Familiar user interface requires no learning curve for Microsoft Office users.Powerful data validation and formula features for seamless data management.
microsoft office alternative - wps office

Frequently Asked Questions

Why shouldn't I use long-running database transactions in Microsoft Access?

Keeping a transaction open while a user fills out a form places severe locks on tables and records. In a multi-user environment, this prevents other users from accessing or modifying the data, leading to application freezes, timeouts, and conflicts.

Can I use the built-in Access Undo command for multiple subforms at once?

No. The built-in 'Me.Undo' command generally only works for the current form or the specific record being actively edited. It cannot natively roll back changes across a main form and multiple subforms simultaneously if focus has shifted or records have been auto-saved.

Is it better to use bound or unbound forms for a multi-form data entry interface?

Unbound forms offer more granular control over when data is saved to the underlying tables, making global 'Undo' operations easier to implement. However, they require significantly more VBA coding compared to bound forms, which handle saving automatically.