How to Automatically Track Revision Numbers and Changes in Microsoft Access
Question details
The user needs a method to automatically increment revision numbers and log changes made to database records to maintain a reliable audit history.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Setting up a secure and reliable audit tracking mechanism to log the users, timestamps, and previous values whenever a database record is modified.
- Observed behavior
- Currently seeking a robust way to track revisions and prevent data loss from in-place record updates, rather than just overwriting existing values.
Before configuring update queries or data macros, create a full backup of your Access database file to prevent accidental data loss during testing.
Create a Revision History Table for Full Audit Trails
Instead of merely updating a single number field, use Access Data Macros to automatically copy the old values into a dedicated history table. This provides a complete, reliable audit trail.
A full audit trail ensures you preserve the exact state of previous records, including who made the change and when it occurred.
Design a new table named 'RevisionHistory' containing fields for RecordID, OldValue, NewValue, User, Timestamp, and RevisionNumber.
Open your primary data table in Design View. On the ribbon, navigate to the Table Design tab and click on 'Create Data Macros', then select 'After Update'.
Add a 'CreateRecord' block targeting the 'RevisionHistory' table. Map the [Old].[FieldName] values to your history table's fields to capture the data state before the edit was made.
Save the macro and edit a record in your main table. Check the RevisionHistory table to verify that the previous values, timestamp, and incremented revision number were successfully logged.

Use an Update Query for Basic Tracking
If you only need a simple incrementing counter without preserving old data, you can trigger an SQL Update Query when a record changes.
Utilize SQL Server System-Versioned Tables
For enterprise-level databases, migrating your Access backend to SQL Server allows you to use built-in system-versioned temporal tables for effortless auditing.
Looking for a Free, Lightweight Office Suite? Try WPS Office
While managing complex relational databases requires specific tools like Microsoft Access, you can handle powerful data analysis, reports, and documentation completely free with WPS Office. It provides comprehensive tools for Spreadsheets, Documents, and Presentations without expensive subscriptions.

Frequently Asked Questions
Can MS Access track who made changes to a database automatically?
Access does not track users by default. To log user changes, you must implement an audit trail using Data Macros (in Access 2010 and later) and capture the environment username to log it into a dedicated history table.
What is an Access Data Macro?
Data Macros are triggers attached directly to tables in MS Access. They allow you to execute automated logic, such as inserting audit records into a separate history table, whenever data in the main table is inserted, updated, or deleted.
How do I view previous versions of an Access record?
If you overwrite a record without an established audit trail, the previous version is permanently lost. To view previous versions, you must proactively set up a Revision History table where old record values are inserted via Data Macros before the main table updates.
Is it better to update the existing record's revision number or create a new record log?
For reliable auditing, inserting a new record log into a separate Revision History table is better. It preserves the exact values associated with each previous revision, along with timestamps and user details, without cluttering the primary table.




