Others

Use the Last Entered Value as a Default in a Microsoft Access Form

Natalie TaylorNatalie Taylor Nov 25, 2026 868 views

Question details

The user wants a new form record to default to the value entered in the previous record.

Use the Last Entered Value as a Default in a Microsoft Access Form
Product
Microsoft Access
Device & OS
not provided
Scenario
A user enters multiple records in an Access form and wants a control to retain its last saved value for the current session or future sessions.
Observed behavior
New records should start with the last saved value in the selected control, while still allowing the user to change it.
Before you start

Identify the form control whose value you want to reuse and confirm that the form can save records. The examples below use a text control named Customer; replace that name with your control's name.

Solution 1Recommended

Reuse the last saved value during the current form session

Set the control's DefaultValue after a record is saved so subsequent new records start with that value.

This example is for a text control. The default applies to new records, not records that already exist, and is lost when the form closes.

1
Open the form's event settings

Open the form in Design View, open the Property Sheet, select Form, and choose the Event tab.

2
Create an After Update event

Set After Update to [Event Procedure], then click the ellipsis button to open the VBA editor.

3
Set the control's default

Add this code inside the Form_AfterUpdate procedure, replacing Customer with your text control name: If IsNull(Me!Customer.Value) Then Me!Customer.DefaultValue = "Null" Else Me!Customer.DefaultValue = Chr(34) & Replace(CStr(Me!Customer.Value), Chr(34), Chr(34) & Chr(34)) & Chr(34) End If

4
Test a new record

Save the form, switch to Form View, enter and save a record, then use the New record button to check the Customer control.

Reuse the last saved value during the current form session
When the default changes: The form's After Update event also runs when an existing record is edited and saved, so that record's value becomes the default for later new records.
Free Microsoft Office alternative

Manage Spreadsheet Records with WPS Office

WPS Office is a free, lightweight alternative for everyday document and spreadsheet work, with a familiar interface and Microsoft Office format compatibility for an easier transition. It does not run or fix Microsoft Access forms or their VBA code.

Use WPS Spreadsheets to enter and review tabular records.Open and save Microsoft Excel XLSX files for spreadsheet sharing.Work with a familiar, easy-to-use office interface.Use free office tools in a lightweight suite.
QA img-9

Frequently Asked Questions

Does changing DefaultValue update existing records?

No. A control's DefaultValue supplies a starting value for new records; it does not change values already stored in existing records.

Why is the default gone after I close the form?

A DefaultValue set in VBA during a form session is not automatically stored for future sessions. Save the value in a table and read it in the form's On Load event if it must persist.

Can I change the suggested value in a new record?

Yes. The default is a starting value, so you can edit the control before saving the new record. The After Update event then makes the saved value the next default.

Will the text-control code work for dates and numbers?

The examples format the default as a text expression. Date and numeric controls need appropriately formatted expressions; test their DefaultValue settings for the field type and locale.