logo
search
Others

Fix Access Form Not Saving Default Values on Button Click

Camila MilosovichCamila Milosovich Oct 23, 2026 869 views

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.

How to Fix Access Form Not Saving Default Values on Button Click
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 you start

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.

Solution 1Recommended

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.

1
Open Form Design View

Right-click your form in the navigation pane and select 'Design View'.

2
Access the Button's Click Event

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.

3
Add the VBA Assignment Code

Inside the event procedure, type 'Me.[ControlName] = Me.[ControlName]' (replace [ControlName] with the actual name of your control containing a default value).

4
Save the Record

Add the command to save the record immediately after the assignment, such as 'DoCmd.RunCommand acCmdSaveRecord'.

Force Form to Dirty via VBA Assignment
Code Execution: This method immediately marks the form as 'dirty', allowing native Access save commands to recognize the new record.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install WPS Office: Run the downloaded installer and follow the quick setup wizard.
  3. 3. Open Your Documents: Launch WPS Office and instantly open your existing .docx, .xlsx, or .pptx files with full compatibility.
100% free and lightweight office suite for Windows, Mac, and Linux.Seamlessly open, edit, and save Microsoft Word, Excel, and PowerPoint formats.Familiar user interface with zero learning curve for seamless migration.Built-in PDF editor, template library, and advanced document sharing features.
microsoft office alternative - wps office

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.