Others

How to Find and Audit Unexpectedly Deleted Records in Microsoft Access

Emma BrownEmma Brown Oct 23, 2026 869 views

Question details

The user needs to investigate why database records are disappearing and create an audit log to capture details of any deleted records for future tracking.

How to Find and Audit Unexpectedly Deleted Records in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Setting up a database tracking mechanism to monitor and log unauthorized or unexpected record deletions.
Observed behavior
Records are being deleted unexpectedly from the database, and there is currently no way to see what data was removed or track the deletion events.
Before you start

Before configuring an After Delete data macro, ensure your target Access table is saved, closed, and that you have administrative privileges to modify table design and macro logic.

Solution 1Recommended

Create an Audit Table and After Delete Data Macro

Set up an audit table to capture deleted information automatically using an After Delete data macro.

To track deletions, you need a separate destination table (the audit table) and a data macro triggered directly at the table level. This ensures deletions are logged regardless of whether they occur via a form, a query, or directly in the table view.

1
Create the Audit Table

Create a new table in Access named 'AuditLog'. Add fields to store the deleted data, such as the original fields from your main table, along with 'DeletedDate' and 'DeletedBy'.

2
Open Table Design View

Right-click the main table where records are being deleted unexpectedly and select 'Design View'.

3
Add an After Delete Macro

In the Table Design ribbon, click on 'Create Data Macros' and select 'After Delete'.

4
Configure the Log Record Action

Use the 'Create a Record In' block and select your 'AuditLog' table. Add 'SetField' actions for each column. Crucially, reference the deleted values from the original table using the [Old].[FieldName] syntax (e.g., [Old].[CustomerID]).

Create an Audit Table and After Delete Data Macro
Syntax Requirement: If your macro runs but fields are blank, ensure you are using the [Old].[FieldName] prefix. Without the [Old] qualifier, the macro cannot capture values of a record that no longer exists.
Free Microsoft Office alternative

Looking for a Lightweight Office Suite? Try WPS Office

While WPS Office does not include a direct relational database replacement for Microsoft Access, it is an excellent, free alternative for handling word processing, spreadsheets, and presentations. You can easily track data, maintain lists, and analyze exported database records using WPS Spreadsheet's advanced filtering and tracking features.

  1. 1. Download WPS Office: Visit the official WPS website and download the free WPS Office suite for your operating system.
  2. 2. Import Your Data: Export your Access data as a CSV or Excel file, then open it in WPS Spreadsheet for easy tracking.
  3. 3. Enable Track Changes: Use the Review tab to protect your sheet and track any future modifications to prevent unexpected data loss.
Free, lightweight, and fast installationHighly compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formatsFamiliar tabbed interface for a seamless transitionBuilt-in track changes and historical versions to prevent accidental data loss
microsoft office alternative - wps office

Frequently Asked Questions

Why is my After Delete data macro logging blank records?

This happens when the macro attempts to reference the standard field name of a deleted record. You must explicitly use the [Old].[FieldName] syntax (e.g., [Old].[EmployeeName]) so Access knows to retrieve the value from the deleted state.

Can an After Delete macro track who deleted the record?

Yes. In your 'Create a Record In' block inside the data macro, you can add a 'SetField' action for your 'DeletedBy' field and set its value to the CurrentUser() function or a custom Windows login capture variable if configured.

Is it possible to recover records that were deleted before I created the audit macro?

No, data macros only trigger for actions taken after they are implemented. To recover previously deleted records, you must restore a prior backup of the Access database.

Do cascade deletes trigger After Delete data macros?

Yes. If a parent record is deleted and cascade delete removes related child records, the After Delete macro on the child table will execute for each deleted child record.