Others

Fix Microsoft Access AutoNumber Duplicate Key Errors After an Append Query

Muhammad TalhaMuhammad Talha Nov 22, 2026 870 views

Question details

The user needs to prevent duplicate key errors when adding records after an append query.

Fix Access AutoNumber Duplicate Key Errors After an Append Query
Product
Microsoft Access
Device & OS
not provided
Scenario
Records have been appended to a table that uses an AutoNumber primary key, and the user wants to add more records.
Observed behavior
A new AutoNumber value appears to conflict with an existing ID, causing a duplicate-value error.
Before you start

Identify the destination table and confirm which field or unique index is named in the error. Check whether the append query explicitly supplies values for the AutoNumber field or lets Access generate them.

Solution 1Recommended

Check the Append Query and Refresh the Form

Use this first to rule out explicit ID conflicts, other unique indexes, and a stale form or recordset.

1
Inspect the destination indexes

Open the destination table in Design View and select Design > Indexes. Check the primary key and any other indexes marked Unique for fields that could cause the error.

2
Review the append query

Open the append query in Design View and inspect the Append To row. If existing IDs do not need to be preserved, remove the mapping to the destination AutoNumber field so Access can generate IDs for appended records.

3
Requery the form

After the append finishes, close and reopen the form, or use a Requery action in the form's workflow. Then try adding a record again.

Check the Append Query and Refresh the Form
Refreshing does not reset the seed: Requerying updates the displayed records, but it does not repair an AutoNumber seed that is out of sync. AutoNumber values can also have gaps without indicating a problem.
Free Microsoft Office alternative

Manage Tabular Data with WPS Spreadsheets

WPS Office is a free, lightweight alternative for working with spreadsheet data in a familiar interface. Open compatible Office files to move everyday tabular work to WPS, though it does not repair Access databases or replace Access relational database features.

Review and organize tabular records in WPS SpreadsheetsOpen and edit Microsoft Excel XLSX filesUse a familiar Office-style interface for an easier transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Are gaps in Access AutoNumber values a problem?

No. AutoNumber is intended to generate unique identifiers, not a gap-free sequence. Use a separate field if your workflow requires controlled numbering.

Should my append query include the AutoNumber field?

If you do not need to preserve existing IDs, open the query in Design View and remove the destination AutoNumber field from the Append To mapping. Access can then generate IDs for the appended records.

Will reopening a form fix an out-of-sync AutoNumber seed?

No. Closing and reopening the form or requerying its recordset refreshes the displayed records but does not reset the seed. Try Database Tools > Compact and Repair Database if the seed appears out of sync.

What if the duplicate error is not caused by the primary key?

Open the table in Design View and select Design > Indexes. Check other unique indexes and compare their fields with the values supplied by the append query or new record.