Fix Microsoft Access Search Key Was Not Found Error
Question details
The user is encountering a 'Search key was not found in any record' error when attempting to close a Microsoft Access database.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Closing an Access database application after deleting one or more tables that may still be actively referenced by other database objects.
- Observed behavior
- Microsoft Access displays the error 'The search key was not found in any record' during the database shutdown process without indicating the exact location of the error.
Ensure you have a recent working backup of your database file (.accdb or .mdb) before making any further structural changes to your tables.
Restore Backup and Safely Rename Tables
Instead of permanently deleting tables, restore your most recent backup and rename the suspected tables to test for broken database references safely.
Permanently deleting a table that is still referenced by queries, forms, reports, macros, or startup actions will break the database flow and trigger errors upon closing. By renaming the table instead, you preserve the data while forcing Access to flag exactly which object is looking for the original table name.
Close your current corrupted database completely. Locate the backup file you created before you deleted the tables and open it in Microsoft Access.
In the Navigation Pane, right-click the table you want to remove and select 'Rename'. Add a prefix to the name, such as changing 'tblExample' to 'z_tblExample'.
Run through your regular database tasks. Open forms, run queries, and execute macros to check if the renamed table triggers a missing reference error. This will help you identify what is still using the table.
Once you have verified that no other objects reference the renamed table, create a fresh backup of the database, then right-click the renamed table and select 'Delete'.

Locate and Update Broken References Manually
If you cannot restore a backup, you must manually inspect the database objects to find and remove the references to the already deleted table.
Try WPS Office for Your Document and Data Needs
While WPS Office does not include a direct database management tool like Microsoft Access, it offers a highly compatible, lightweight, and free alternative to Microsoft Word, Excel, and PowerPoint for your everyday document and data processing tasks.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package tailored for your operating system.
- 2. Install the Software: Run the downloaded installer file and follow the simple on-screen instructions to set up the suite on your device.
- 3. Open and Edit Your Files: Launch WPS Office to easily open, edit, and save your existing Word, Excel, and PowerPoint documents without losing formatting.

Frequently Asked Questions
Why does the 'Search key was not found' error only appear when closing the database?
This typically happens because Microsoft Access runs background processes upon closing, such as saving layout changes, compacting the database, or executing shutdown macros. If any of these automated processes reference a table you just deleted, the application fails to find it and triggers the error.
Can I recover the deleted table if I don't have a backup?
Unfortunately, once a table is deleted in Microsoft Access and the action is committed, it cannot be undone using a simple 'undo' command. You will either need to recreate the table structure manually or re-import the data from an original external source.
How do I find exactly which query or form is causing the error?
Because the error message does not specify the location, you must use a process of elimination. Restoring a backup and temporarily renaming the table instead of deleting it will force Access to immediately flag the specific query or form that breaks when you try to open it.




