Problem: Runtime error 3211 using Access VBA

Problem: Runtime error 3211 using Access VBA

Hi ,

I encountered the run-time error 3211:
The databse engine couldn’t lock ‘TempTable’ because it is in use by another person or process.

Currently, I built in the function in MS Access using VBA such that each time I click on “Update” button, a table “TempTable” will be imported from Excel. Then information I need will be picked up from “TempTable” and copied to other tables that I have. After this, the “TempTable” will be deleted after the command:

CurrentDb.Execute “DROP TABLE TempTable”

This run-time error happens each time when I try to click on “Update” for the second time. If I close the program, restart it and click on “Update”, it works fine.

Can anyone help me explain the error? Any solutions on this?


Solution: Runtime error 3211 using Access VBA

It’s probably inside the code that’s tapping the TempTable.  Any Open Recordsets that may still be attached to it?  Might help to see the code you’re using when you Click Update.