Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Table if it Exists 1

Status
Not open for further replies.

SeaRay

Technical User
Jan 8, 2002
20
US
How do I write code to delete a table if it exists?
 
Hi SeaRay,

Please specify the programs you're using: do you want to delete a Word, Excel, Acces or other table?
Giving a little more detail would be helpful.

Ilses
 
If you mean in MS Access then:

Public Sub DeleteTable(strTableName as string)
On Error Resume Next

DoCmd.DeleteObject acTable, strTableName

ExitHere:
Exit Sub

End Sub

Hope this helps.

Ed Metcalfe.
 
Sorry Ilses, I meant Access. Thanks ED2020.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top