Fix Access Form Not Saving Default Values on Button Click
Question details
Users are unable to save a new record in a Microsoft Access dialog form when the controls contain only default values, as Access does not recognize the form as having changes to save.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Attempting to save a new record via a button click on an Access dialog form that was opened from a ComboBox NotInList event.
- Observed behavior
- The form fails to create a new record because controls containing only default values do not trigger the form to be marked as 'dirty' or modified.
Before modifying your database code, ensure you have backed up your Microsoft Access database file (.accdb) to prevent any accidental data loss while editing VBA scripts.
Force Form to Dirty via VBA Assignment
Explicitly set a control's value to itself in the button's Click event to mark the form as dirty and allow the record to save.
Access requires at least one field to be physically modified to initiate a new record. Assigning the default value back to itself tricks Access into registering a change without altering the intended data.
Right-click your form in the navigation pane and select 'Design View'.
Select the save button, go to the Property Sheet, click the 'Event' tab, and click the ellipsis (...) next to 'On Click' to open the VBA Editor.
Inside the event procedure, type 'Me.[ControlName] = Me.[ControlName]' (replace [ControlName] with the actual name of your control containing a default value).
Add the command to save the record immediately after the assignment, such as 'DoCmd.RunCommand acCmdSaveRecord'.

Create Record using DAO Recordset
Bypass the form's default value limitation by creating the record directly through a Data Access Object (DAO) recordset.
Looking for a Free Office Suite? Try WPS Office
While WPS Office does not include a database application like Microsoft Access, it is a powerful, lightweight, and completely free alternative for your word processing, spreadsheet, and presentation needs. It's fully compatible with Microsoft Office formats.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button.
- 2. Install WPS Office: Run the downloaded installer and follow the quick setup wizard.
- 3. Open Your Documents: Launch WPS Office and instantly open your existing .docx, .xlsx, or .pptx files with full compatibility.

Frequently Asked Questions
Why do default values appear on my Access form but not save?
Default values are populated on the form for visual convenience, but Microsoft Access does not allocate a new record in the underlying table until at least one field is explicitly modified by the user or via code (making the form 'dirty').
What does it mean for a Microsoft Access form to be 'dirty'?
A form is considered 'dirty' when a record has been modified but not yet saved. Access relies on this 'dirty' state to trigger the creation of a new record in the database.
Can I use macros instead of VBA to force the form to save?
Yes, you can use the SetProperty macro action to set a control's value to itself before calling the SaveRecord macro action, achieving the exact same effect as the VBA assignment method.




