Preserve Year-Based Numbering When Combining Microsoft Access Tables
Question details
Combine yearly Access tables while retaining identifiers such as 2015-1 and 2016-1.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Records from separate yearly tables need to be stored in one table without losing their year-specific numbering.
- Observed behavior
- AutoNumber provides a unique internal identifier but cannot generate or preserve a formatted year prefix as a year-specific sequence.
Identify the year and original sequence number for each source record, and check for duplicate year-and-sequence pairs before appending. Decide which fields in the yearly tables map to the combined table.
Combine records using separate year and sequence fields
Use one table to preserve existing year-based numbers and generate new numbers within each year.
Keep AutoNumber as an internal primary key, not as the displayed year-based number. Store the year and sequence separately, then combine them for display.
DMax can suggest the next sequence number, but simultaneous users can receive the same result. A unique index must reject duplicates, and the application should handle conflicts by retrying the operation.
In Access, select Create > Table Design. Add an AutoNumber primary key, a Number field named RecordYear, a Number field named SequenceNumber, and the other fields your records need.
In Table Design, open Design > Indexes. Create a unique composite index containing RecordYear and SequenceNumber, and set both fields as required so each record has a complete year-and-sequence pair.
Select Create > Query Design and build an Append query for each source table. Map the original year and sequence to RecordYear and SequenceNumber, leaving the new AutoNumber field out of the append. If the old identifier is text such as 2015-1, split it into its year and numeric sequence before or during the append.
In a query, add the calculated field DisplayNumber: [RecordYear] & "-" & [SequenceNumber]. Use that field in forms or reports to display values such as 2015-1.
In the data-entry form's VBA code, calculate the next sequence for the selected numeric year with an expression such as Nz(DMax("SequenceNumber", "CombinedRecords", "RecordYear=" & selectedYear), 0) + 1. Replace CombinedRecords and selectedYear with your table and variable names, and retry if the unique index rejects a concurrent duplicate.

Work with exported Access data in WPS Spreadsheets
WPS Office is a free, lightweight alternative for working with documents and spreadsheets in a familiar interface. Open exported Access data in WPS Spreadsheets for review, while keeping database design and multi-user numbering in Access.

Frequently Asked Questions
Can Access AutoNumber restart its sequence for each year?
AutoNumber is intended to provide unique identifiers, not reliable year-specific sequences. Use separate RecordYear and SequenceNumber fields for identifiers such as 2016-1.
How can I prevent two records from having the same year-based number?
In Table Design, open Design > Indexes and create a unique composite index on RecordYear and SequenceNumber. Make both fields required and handle duplicate-key errors when saving.
What happens to existing AutoNumber values when I append the yearly tables?
If you omit the destination AutoNumber field from the Append query, Access assigns new internal IDs. Preserve the original year and sequence in separate fields before appending if they are needed for the displayed identifier.
Is DMax safe for generating numbers when several people are entering records?
DMax alone is not sufficient: two users can calculate the same next number. Enforce a unique year-and-sequence index and retry after a duplicate conflict, or use suitable transaction-based allocation logic.




