Others

How to Create a Year and Sequential Case Number in Microsoft Access

Rana GarciaRana Garcia Oct 29, 2026 868 views

Question details

The user needs to generate and display a unique identifier combining a year and a sequential case number (e.g., 2021-1) in Microsoft Access.

How to Create a Year and Sequential Case Number in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Designing a database table or query that requires a structured, unique case identifier based on the current year and a sequential number.
Observed behavior
Combined identifiers are difficult to query and sort. The best practice is to store the year and sequence number as separate atomic fields and concatenate them only for display.
Before you start

Ensure you have Design View access to your Microsoft Access database tables and queries before modifying the field structures.

Solution 1Recommended

Store Values Separately and Concatenate for Display

The best practice in relational databases is to store the year and sequence number as atomic values and combine them dynamically in queries or reports.

Relational database fields should contain atomic (indivisible) values. Storing the year and sequence number in separate fields ensures data integrity and makes sorting, filtering, and resetting the sequence much easier.

1
Create separate table fields

Open your table in Design View. Create two separate fields: name one 'TheYear' (set data type to Number) and another 'SeqNo' (set data type to Number).

2
Concatenate fields in a query

Create a new query based on your table. In the Field row of the query design grid, enter the expression: ID: [TheYear] & "-" & [SeqNo].

3
Apply to forms and reports

Use the new query as the Record Source for your forms and reports. Bind the calculated 'ID' field to a text box for display purposes.

Store Values Separately and Concatenate for Display
Data Normalization: By keeping the values separate, you adhere to strict database normalization rules, preventing future data retrieval errors.
Free Microsoft Office alternative

Looking for a Lightweight, Free Office Suite?

While Microsoft Access handles complex relational databases, WPS Office is the perfect lightweight alternative for managing your daily exported data, documents, and presentations without subscription fees.

  1. 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install WPS Office: Run the downloaded file and follow the straightforward on-screen instructions to install the suite.
  3. 3. Analyze Exported Data: Open WPS Spreadsheet to import and seamlessly analyze data reports generated from your databases.
Manage and analyze exported database reports easily using WPS Spreadsheet.Fully compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formats.Lightweight architecture ensures smooth performance even on older computers.Completely free to use with a familiar, easy-to-navigate tabbed interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why shouldn't I store the combined year and sequence number in a single Access field?

Storing them together violates relational database principles (atomicity). It makes extracting just the year or sorting records numerically by the sequence number much more difficult. Storing them separately and combining them for display is safer and more efficient.

Can I use an AutoNumber field to generate sequential case numbers?

AutoNumber fields in Access are designed strictly to provide a unique identifier, not a gapless sequential number. If a user starts creating a record and then cancels, the AutoNumber will skip a value, breaking your sequence.

How do I reset the sequence number to 1 at the start of a new year?

You can implement a VBA script in the BeforeInsert event of your form. The script checks if any records exist for the current year using DCount or DMax; if none exist, it assigns '1' to the SeqNo field, effectively resetting the count for the new year.