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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting object only if it exists

Status
Not open for further replies.

jommyjet

Technical User
May 19, 2003
49
US
I imagine this is very simple. I want to delete the table if it exists.
I bet it's something similar to this

If IsObject(resourcelist) = True Then
DoCmd.DeleteObject acTable, "resourcelist"
Else
End If

Thanks for the help. Also, as this being easy, can anyone recommend a good resource book. I biought a VBA handbook and it reads like garbage
 
For something like this where you don't care about an error if the table does not exist try the following:

On Error Resume Next 'Turn off error handling
DoCmd.DeleteObject acTable, "resourcelist"
On Error GoTo 0 'Reset error handling

Good Luck!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top