How to Fix "Record Is Deleted" Error When Clearing a Table in Access
Question details
The user encounters a "Record is deleted" error while running a macro to clear a temporary table for an inventory report.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Running an Access macro or VBA code to print an inventory report, which requires clearing out a temporary data table.
- Observed behavior
- The execution halts, the debugger highlights the DAO Recordset.Delete method, and the system displays a "The record is deleted" error message.
Before modifying your database macros or VBA modules, ensure you have created a backup copy of your MS Access database to prevent any accidental data loss.
Use a SQL DELETE Statement Instead of Recordset.Delete
Replace the DAO Recordset loop with a direct SQL DELETE action query to safely and efficiently empty the entire temporary table.
The DAO Recordset.Delete method is designed to remove only the current row from the active recordset. It does not delete the recordset object itself or empty the underlying table. Attempting to loop through records using this method often results in a "Record is deleted" error if the pointer loses its place.
To properly empty a temporary table, executing a SQL DELETE command is much cleaner. It bypasses the need to loop through individual rows, directly clearing the data and avoiding pointer-related errors.
Launch your MS Access database and open the VBA editor by pressing Alt + F11, or open the specific macro that is causing the error in Design View.
Find the section of your code that loops through the recordset using the DAO Recordset.Delete method to clear the table.
Remove the loop and replace it with a SQL execute command. For example, use CurrentDb.Execute "DELETE FROM tbl_Temp_QA_Sheet", dbFailOnError (replace 'tbl_Temp_QA_Sheet' with your actual table name).
Save your VBA module or macro. Run your inventory report again to verify that the temporary table clears successfully without triggering the error.

Looking for a Reliable Office Suite? Try WPS Office
While Microsoft Access is a specialized database tool, for your everyday document, spreadsheet, and presentation needs, WPS Office provides a free, lightweight, and powerful alternative to Microsoft Office.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button to get the latest version.
- 2. Install WPS Office: Run the downloaded file and follow the simple on-screen instructions to complete the installation.
- 3. Start Creating: Open WPS Office to immediately start working on documents, spreadsheets, and presentations with full Microsoft compatibility.

Frequently Asked Questions
Why does the DAO Recordset.Delete method trigger a 'Record is deleted' error?
This error usually occurs in a loop when the code attempts to reference, manipulate, or delete a record that has already been removed or when the record pointer has not correctly moved to the next valid row using a command like MoveNext.
What is the fastest way to empty a table in MS Access?
The fastest and most efficient way to empty a table is by executing a SQL DELETE query (e.g., DELETE FROM TableName). This processes the deletion at the database engine level instantly, rather than row by row.
Can I recover records deleted by a SQL DELETE statement in Access?
No, once records are deleted using an action query or recordset deletion, they are permanently removed from the table. You can only recover them if you have a prior backup of your database.




