How to Prevent Access Datasheet View Changes from Being Saved
Question details
The user needs to stop Microsoft Access from automatically saving layout changes made by users in Datasheet view.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Users interact with forms in Datasheet view, modifying column orders, resizing widths, and applying filters, but the application should discard these changes upon closing.
- Observed behavior
- Access automatically saves the users' column resizing, column order, and filter changes, altering the default design-time layout for subsequent sessions.
Before modifying form properties or adding VBA code, ensure you have created a backup copy of your Microsoft Access database to prevent accidental data or design loss.
Use DoCmd.Close with acSaveNo in VBA
Force Microsoft Access to discard any design or layout changes made during the session by explicitly closing the form via VBA.
By intercepting the form's close action with a specific VBA command, you can dictate exactly how Microsoft Access handles modifications made to the layout.
Launch your Microsoft Access database, locate the target form in the Navigation Pane, right-click it, and select 'Design View'.
Navigate to the Form Design tab, select the 'Button' control, and place it on your form. Cancel the wizard if it appears.
With the button selected, open the Property Sheet (F4), go to the 'Event' tab, click the ellipsis (...) next to 'On Click', and choose 'Code Builder'.
In the VBA editor, type the following code between Private Sub and End Sub: DoCmd.Close acForm, Me.Name, acSaveNo
Save your VBA code and form design. Open the form in Datasheet view, change a column width, and click your new Close button. Reopen the form to verify the original layout is restored.

Distribute Separate ACCDE Front-End Files
Prevent users from permanently modifying the core database design by giving each user a compiled, locked-down version of the front-end.
Replace Datasheet View with a Continuous Form
Gain absolute control over the form's appearance and prevent user resizing by building a custom continuous form instead of using the default Datasheet view.
Looking for a Reliable, Free Office Suite?
While Microsoft Access requires a paid Microsoft 365 subscription for database management, you can handle all your daily document, spreadsheet, and presentation needs for free with WPS Office. It provides a lightweight, highly compatible alternative to Microsoft Word, Excel, and PowerPoint.

Frequently Asked Questions
Why does Access save my datasheet layout changes automatically?
By default, Microsoft Access is designed to remember user preferences such as column widths, column orders, and applied filters in Datasheet view. This behavior is intended to provide a personalized user experience without requiring reconfiguration each time the database is opened.
Does the acSaveNo command discard new data entries?
No, using DoCmd.Close with acSaveNo only discards changes made to the design or layout of the form (like resizing a column). Record additions, deletions, and edits to the actual database tables are still saved normally as users interact with the data.
Can I disable layout saving without using VBA code?
Yes, splitting your database and converting the front-end to an ACCDE file is a code-free alternative. An ACCDE file compiles the application and locks down all design capabilities, preventing users from permanently saving their layout modifications.




