Use the Last Entered Value as a Default in a Microsoft Access Form
Question details
The user wants a new form record to default to the value entered in the previous record.

- 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.
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.
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.
Open the form in Design View, open the Property Sheet, select Form, and choose the Event tab.
Set After Update to [Event Procedure], then click the ellipsis button to open the VBA editor.
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
Save the form, switch to Form View, enter and save a record, then use the New record button to check the Customer control.

Store the last value for future Access sessions
Use a separate defaults table to save the value and restore it when the form opens.
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.

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.




