Deleting Tables

Milan

Registered User.
Local time
Today, 03:56
Joined
Feb 17, 2002
Messages
85
Hi People!

How can i delete a table (not just the records , but the table itself) from vba.

Is it done using the tabledef object?


Thanks Again.
 
What version of Access do you use? Or more precisely, are you using DAO or ADO?

You can also do it through SQL with this:
"DROP TABLE yourtablename;"
 
i was planning to use DAO.!
 

On Error Resume Next
CurrentDb.TableDefs.Delete "yourtablename"


The error check is just there in case you try to delete a table that doesn't actually exist. Just put this into your code and run. You might want to make the sub a bit more useful and pass the tablename as a parameter.
 
Thanks!! I have found the answer!! in this forum!.

Thanks for your help!!
 
dcx693 Thanks

i used your solution, work a treat!!

Cheers for that!
 

Users who are viewing this thread

Back
Top Bottom