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

Simple Question

Status
Not open for further replies.

goatsaregreat

Programmer
Mar 21, 2001
82
GB
I am trying to create Error Handling code that will jump a line if a certain error occurs. Here is the problem. I have to delete a table from a DB on exiting a form. The problem is, that I need to have that table deleted and created multiple times during the life of the form. I have no problem with that aspect. The problem is, sometimes, when I get to the form's unload event, the table is already deleted. I need to know how to jump that line of code if the table is gone already. TIA for your help. Here is the code I am using to dump the table.

db.Execute "drop table tblquery"
 
Two easy ways would be to set a flag indicating whether table exists or not. Then don't issue the drop statement unless you have to.

Another would be to use on error resume next before your drop statement.

A 3rd would be to check for the existence of the table before issuing the drop - which is something I don't know how to do without playing with code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top