Cannot delete a table with a macro action

  • Thread starter Thread starter Heinz-Oz
  • Start date Start date
H

Heinz-Oz

In Access 2003, I am developing a database and create a temporary table with
a make table query. Once I am done with the table and have closed all objects
based on that table, Access will not alow me to delete the table with a macro
action "DeleteObject". It tells me that the data base engine could not lock
the table because another user is accessing it. There is no other user and no
object is open which is connected with that table.

I have tried everything I could think of, in vain. When I close the error
mesage and select the table in the database window, I can delete it. I even
tried to select the table in the database window inside the macro and prior
to deleting it. Still no success. What could be causing it?
 
What processes does the table go through before hand?

If you try to insert the Close command from your macro for your table before
you try do delete it, do you receive an error?

Have you tried writing your macro in code, instead? It might be a little
easier, as you can ensure that the recordset/table object is closed (not just
opened by some process in the background) before trying to delete it.
 
Another thing you may want to try, is inserting a message box. It almost
looks like the macro is running commands quicker than your computer can
perform all of its operations. A msgbox will force a pause, and might
correct this problem.
 
The table provides data to display in a form only. The form as well as the
query the form is based on are closed when I try to delete this table.

I have tried the close command on the table also and did not receive an
error message. The table could still not be deleted though.

Could you give me an example of suitable code to make sure the table is not
locked prior to deletion?
 
I tried the MsgBox action also but no success. Access will not let me delete
this table.
 
Back
Top