VBA & Macro Problems

How to Use an Access Form Button to Duplicate Records Without Refreshing

Amos GikundaAmos Gikunda Oct 20, 2026 869 views

Question details

The user wants to add or duplicate specific records in a Microsoft Access form using a command button without triggering a form refresh or relying on a continuous form.

How to Add or Duplicate Records Without Refreshing via Access Form Button
Product
Microsoft Access
Device & OS
not provided
Scenario
Entering multiple related records (such as keeping the same part number but changing the quantity) seamlessly using a VBA command button.
Observed behavior
Instead of using a continuous form layout, the goal is to save the current form data, generate a new record, and retain selected values via a single button click.
Before you start

Ensure you have design-view access to your Microsoft Access database and that macros or VBA code execution are enabled in your Trust Center settings.

Solution 1Recommended

Use VBA and DefaultValue to Duplicate Specific Form Values

Assign a VBA click event to a command button to seamlessly save the current record, copy specified values, and move to a new record.

This method utilizes the DefaultValue property to temporarily store the values you wish to carry over to the new record. Once the new record is created, these values are populated automatically without refreshing the entire form.

1
Add a Command Button

Open your form in Design View. Go to the Form Design tab, select the Button control, and draw it on your form. Cancel the wizard if it appears.

2
Access the VBA Code Builder

Right-click the newly created button, select 'Build Event', choose 'Code Builder', and click OK to open the VBA editor.

3
Save the Current Record

Inside the click event procedure, insert the code `DoCmd.RunCommand acCmdSaveRecord` to ensure the active record is saved first.

4
Set Default Values for Target Controls

Store the current control values to their DefaultValue properties. For example, use `Me.PartNumber.DefaultValue = """" & Me.PartNumber.Value & """"` to temporarily hold the part number.

5
Navigate to a New Record and Reset Defaults

Use `DoCmd.GoToRecord , , acNewRec` to navigate to a new blank record. Afterwards, clear the DefaultValue properties (e.g., `Me.PartNumber.DefaultValue = ""`) so future manual records start entirely blank.

Use VBA and DefaultValue to Duplicate Specific Form Values
Test Your Code: Always switch back to Form View to test the button's functionality and verify that only the intended fields are duplicating before deploying the form.
Free Microsoft Office alternative

Looking for a Lightweight Alternative for Your Office Tasks?

While WPS Office does not include a relational database program like Microsoft Access, it offers a powerful, free alternative for Word, Excel, and PowerPoint with advanced VBA and macro support for your complex data management and spreadsheet needs.

  1. 1. Download WPS Office: Download and install the free WPS Office suite from the official website.
  2. 2. Open WPS Spreadsheet: Launch WPS Spreadsheet to manage tabular data efficiently using built-in data forms and advanced formulas.
  3. 3. Enable the Developer Tab: Access the Developer tab to write custom VBA macros and automate your daily data entry workflows.
Fully compatible with Microsoft Excel (.xlsx, .xls, .xlsm) and supports advanced spreadsheet macros.Lightweight and fast, requiring significantly less system memory and storage than other office suites.Familiar user interface makes transitioning from Microsoft Office completely seamless.Built-in PDF editing and data extraction capabilities at no extra cost.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Access form refresh entirely when clicking a button?

By default, certain macros or a Requery command will refresh the entire form or database. Using targeted VBA commands like DoCmd.GoToRecord ensures you only move to a new record without triggering a full visual refresh.

Can I copy only specific fields like Part Number but leave Quantity blank?

Yes. In your VBA code, simply set the DefaultValue or variable assignment only for the controls you want to duplicate. Any controls ignored in your VBA script will remain perfectly blank on the new record.

What is the difference between a continuous form and a single form for data entry?

A continuous form displays multiple records simultaneously in a scrolling list format, whereas a single form displays only one record at a time. The VBA duplicate button method is ideal for single forms to maintain a clean interface while quickly generating sequential data.