How to Restore Microsoft Access Form Control Properties at Runtime
Question details
The user needs a way to restore the original Design view properties (such as colors and positions) of Microsoft Access form controls during runtime after they have been dynamically modified using VBA.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Modifying form control formatting and positioning dynamically via VBA scripts and needing to revert the form to its original default layout without manual intervention.
- Observed behavior
- Access does not natively expose or remember the design-time values of modified properties while the form is actively running, making it difficult to reset them programmatically.
Ensure you have created a backup copy of your Access database before writing and testing VBA scripts, as errors in runtime property manipulation can sometimes cause the form to behave unpredictably.
Store Original Values in a Metadata Table
Create a dedicated reference table to hold the default formatting values and write a VBA function to fetch and apply them when a reset is needed.
Because Access does not retain a memory of design-time formatting values once they are altered at runtime, storing these defaults externally is the most robust approach. By querying an external table, you can programmatically reapply the original properties at any time without needing to reload the form.
Design a new table named 'tblControlDefaults' with fields for 'ControlName' (Short Text), 'PropertyType' (Short Text, e.g., Color, Top, Left), and 'PropertyValue' (Short Text or Number).
Manually input the original Design view values for each control you plan to modify during runtime into this new table.
In your form's VBA module, write a subroutine that opens a Recordset to query 'tblControlDefaults'. Use a loop to iterate through the records and assign the queried values back to the controls (e.g., Me.Controls(rs!ControlName).BackColor = rs!PropertyValue).
Assign this subroutine to the 'On Click' event of a Reset button on your form to trigger the restoration instantly.

Close and Reopen the Form Without Saving
A quick workaround is to close the active form without saving any design changes and immediately reopen it, which restores it to the original Design view state.
Discover WPS Office - Your Free Office Alternative
While complex relational database management requires tools like Microsoft Access, WPS Office offers an exceptional, free, and lightweight alternative for all your Word, Excel, and PowerPoint tasks. Enjoy a familiar interface and seamless migration without expensive subscription fees.
- 1. Download the Installer: Visit the official WPS Office website and click the Free Download button to get the latest version.
- 2. Install the Suite: Run the downloaded executable file and follow the simple on-screen instructions to install the software.
- 3. Open and Create: Launch WPS Office to immediately start working on your documents, spreadsheets, and presentations with full Microsoft compatibility.

Frequently Asked Questions
Why doesn't Microsoft Access remember original formatting properties natively?
Access optimizes runtime memory by only holding the current state of a form's properties. It relies on the saved Design view file for defaults, which is not dynamically queryable by VBA during standard execution without reloading the form.
Can I use Conditional Formatting instead of VBA to change control colors?
Yes. For straightforward rules based on field values, Access Conditional Formatting is highly recommended. It handles the logic automatically and reverts to default formats when conditions are no longer met, eliminating the need for VBA reset scripts.
Does closing an Access form via VBA discard data entered by the user?
If the form is bound to a data table, Access typically attempts to auto-save the record when closing. However, if the form uses unbound fields or you explicitly undo the record changes before executing the close command, unsaved data will be lost.




