The error 3340 - Access query is corrupt - usually appears when you try to run an update query in the Access VBA code. This issue prevents you from modifying data in the database. It can occur if you are using complex SQL queries in Access, such as Nested Update queries or queries that include multiple tables and joins. Besides this, there are many other reasons that may lead to this issue.
Causes of Error 3340 in MS Access
This error can occur due to one of the below reasons:
- Queries are corrupted.
- The database in which you are running the query is corrupted/damaged.
- Your system memory configuration failed to handle complex queries.
- Issue with Office updates.
- Missing parameters or arguments in the query.
- The ‘Where’ clause in Update Query is referring to an incorrect record.
- Complex SQL queries.
Methods to Fix the MS Access Error 3340
Below are some methods you can follow to resolve the error 3340 in MS Access.
Method 1: Install the Latest Office Updates
Many Access users have reported encountering this error after installing the security patches and the latest Office updates (such as KB4484127, KB4484119, KB4484113, and KB3085368 released on November 12, 2019). To address this, Microsoft has released another update. If you’re using Office 2013, you can install the update 4484186. You can install the update KB3085368, if you’re using Office 16.
Method 2: Roll Back the Latest Office Update
If the Access error 3340 occurred after installing the recent Office updates, then you can try to roll back the updates to resolve the issue. To do so, follow these steps:
- Open your system’s Control Panel.
- Under programs, click uninstall a program.
- Under Programs and Features, click View Installed Updates.
- In the Installed Updates window, search for the below updates:
- KB4484127 (for Access 2010)
- KB4484119 (for Access 2013)
- KB4484113 (for Access 2016)
- Right-click on the update and click uninstall.
- Follow the instructions on the screen to uninstall the update.
- Once the installation is complete, then restart the system.
If you fail to uninstall the updates, then follow the next methods.
Method 3: Change the Database Location to a Trusted Location
You may also get the error 3340 if your database is not at the trusted location. By default, Access fails to display action queries such as update and delete if your database is at an untrusted location. In this case, you can move the database to a trusted location. Follow these steps:
- In Access, go to File and then click Options.
- In the Access Options window, select Trust Center.
- Click Trust Center Settings under Microsoft Office Access Trust Center.
- Click Trusted Locations on the Trust Center window.
- In the Trusted Locations dialog box, click on My Network checkbox and select Allow Trusted Locations to add a network location.
- Select Add New location.
- In the Microsoft Office Trusted window, select one of the following options:
- In the Path field, type the path of the location you want to add.
- Click the Browse button to browse to the location.
- Click “Subfolders of this location are also trusted“, if you want to specify the subfolders.
- Once you added a trusted location, select OK.
- Now, move the database to the newly added location.
Method 4: Check and Simplify the Queries
The error 3340 can occur if there is an issue with the queries in the database. It usually occurs when you run complex SQL queries using joins, numerous tables, or nested functions. So, check the query you’re running and simplify it by removing unwanted joins, functions, or subqueries. Also, check and correct the syntax errors of the query.
Method 5: Verify and Enable Referential Integrity
You can experience the error 3340 when running an update query in the database with multiple types of table relationships. It usually occurs if the relationship field option - Referential Integrity is disabled. You can try enabling the Referential Integrity option to fix the issue. Here are the steps:
- In the Access database, go to Database Tools and then choose Relationships.
- Double-click on the line between two tables.
- In the Edit Relationships window, select the checkbox labeled “Enforce Referential Integrity”.
- Click OK.
- Now, close the Relationships window.
Method 6: Use ADO/DAO Recordsets Query
You may get the error 3340 in Access when using update queries to update the records. To fix this, you can replace the Update query with the Recordsets query, such as Recordset Object (ADO) function. It helps in simplifying the complex query.
Method 7: Repair the Database
The runtime error 3340: Access query is corrupt can occur due to database corruption. You can try repairing the database using the “Compact and Repair” utility in Access. Here are the steps:
- Open the affected Access database.
- Go to the File menu.
- Click on the Info option and then select Compact & Repair Database.
The repaired database will be saved at the exact location where your original database is located.
What if the Above Methods Fail to Fix the Access Error 3340?
If the above methods fail to fix the issue, then you can try Stellar Repair for Access. It is an advanced tool that can repair severely corrupted Access files. It helps repair both .MDB and .ACCDB files and restore the database to its original form with all the data intact. You can try the software’s demo version to evaluate its functionality. The tool is compatible with all Access versions.
To Conclude
You may get the Access error 3340 for several reasons, such as issues with the recently installed Access updates, issue with the query, etc. You can try the methods mentioned above to fix the error. If nothing works, you can use Stellar Repair for Access - a professional tool to repair corrupted Access database file. It helps fix the error if it has occurred due to corruption in database file.