How to Fix Access Data Macros for Tracking Record Changes
Question details
An Access data macro fails to create an audit record when a specific field is updated through a form.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Setting up a data macro to track and audit modifications to a VendorName field via an entry form.
- Observed behavior
- The macro does not trigger or insert a new record into the audit table when the field value is changed.
Ensure that your target audit table (e.g., tblAudit) is already created with the correct field names and data types to store the tracked changes.
Correct the Data Macro Condition Syntax
Fix syntax errors in your data macro condition to ensure Access properly detects field updates.
Data macros in Microsoft Access require highly specific syntax to function correctly. A common mistake when auditing field changes is using the incorrect function name or forgetting quotation marks. The function to check if a field was modified is 'Updated', not 'Update'.
Open your Microsoft Access database and navigate to the main table where your data macro is applied.
Click on the 'Table' tab on the ribbon and select 'After Update' under the Data Macros group to open the macro designer.
Locate the 'If' block checking for field changes. Change the condition from Update("VendorName") to Updated("VendorName"). Ensure the field name is enclosed in exact quotation marks.
Check the 'Create a Record In' block. Ensure that the expressions matching your audit table fields correspond exactly to your table structure (e.g., setting the audit field to [Old].[VendorName]).
Save the macro, close the macro designer, and test the process by changing the VendorName in your form to verify the audit record is created.

Use Form VBA to Insert Audit Records
Use Visual Basic for Applications (VBA) on the form as a reliable alternative to table-level data macros.
Looking for a simpler way to manage and track data?
While Microsoft Access handles complex relational databases, WPS Office provides an excellent, free alternative for everyday data management. With WPS Spreadsheet, you can easily track changes without writing complex VBA code or troubleshooting macro syntax.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Import Your Data: Open WPS Spreadsheet and easily import your existing data tables or CSV files.
- 3. Enable Change Tracking: Navigate to the 'Review' tab and enable 'Track Changes' to effortlessly monitor all edits without macros.

Frequently Asked Questions
Why is my Access data macro not triggering on field updates?
This is often due to a syntax error in the condition statement. For example, using 'Update([FieldName])' instead of the correct syntax 'Updated("FieldName")' will prevent Access from recognizing the modification.
What is the difference between a data macro and VBA in Access?
Data macros operate at the table level, meaning they will trigger regardless of how the data is modified (e.g., via forms, direct table edits, or queries). VBA is typically bound to forms or reports and only runs when data is changed through that specific user interface.
How can I capture the previous value of a field before it was changed?
In an Access data macro, you can reference the previous state using '[Old].[FieldName]'. In Form VBA, you can capture it using the '.OldValue' property of the specific form control, such as 'Me.VendorName.OldValue'.




