Thanks for taking the time to read my question.
I have code that is running a docmd.runsql on a table (Append query). After
I run the query I want to delete the table. I can't becuause the table is
still in use.
Error: 3211, DB could not lock table 'table1' because it is already in use
by another user.
How do I release this table so that I can delete it?
Thanks,
Brad
Brad,
Am I missing something? You want to delete a table just after adding data to
it? That's like making a sandwich, and throwing it away before eating.
I don't know how you're deleting the table, but the following construct
might help you on your way.
On Error Resume Next
Do
DBEngine(0)(0).TableDefs.Delete "tblMyTable"
DoEvents
Loop Until (Err <> 3211)
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
> Thanks for taking the time to read my question.
>
[quoted text clipped - 11 lines]
>
> Brad
Brad - 07 Dec 2005 21:25 GMT
Hi Graham,
I forgot one word; "Source" table. I want to delete the source table after
appending the data to another table.
I got it figured out. I put the code in a different sub that gets fired
after the sub that I was in, is done.
Thanks for your help,
Have a great day,
Brad
> Brad,
>
[quoted text clipped - 29 lines]
> >
> > Brad