Delete tables VBA code

MikeKIA

New member
Local time
Yesterday, 16:29
Joined
Mar 27, 2007
Messages
6
Hi,

I'm trying to delete a table once I've used it and always get the same error saying that the table is already in use, these are the commands I've tried:

DB.TableDefs.Delete ("Report")

AND

strSQL = "DROP TABLE Report"
DB.Execute (strSQL)

Can't figure out how to avoid this. Please help

Mike
 
You have to make sure any queries, reports, or forms that may use that table are closed before being able to delete the table. If you've opened the table via code, any variables that are associated with that table should be set = nothing to release them also.
 

Users who are viewing this thread

Back
Top Bottom