presence76
MIS
I have a problem. I have a table that is created in an ACCESS DB that runs daily. This table is deleted at the beginning of the next run. In certain situations, the table does not exist. I have been trying to test for that situation so I can continue processing without error but have been unsuccessful. Here is what I have done:
Here is the basic command I use to delete the table:
DoCmd.RunSQL "DROP TABLE tbltracerfinal;"
I then changed it to :
DoCmd.RunSQL "DROP TABLE tbltracerfinal;"
On Error Resume Next
This does not work as VB kicks an SQL error statement before it interprets the next line (ON Error....)
I tried several different versions of SQL code that I thought would work like:
'DoCmd.RunSQL "If (tblTracerfinal) then DROP TABLE tblTracerfinal;"
This has faulty SQL code.
Does anyone know how to check for the existence of a table using SQL in a VBA environment?
OR
Does anyone know how I could do it using VBA code???
Any help would be greatly appreciated. Thanks.
Here is the basic command I use to delete the table:
DoCmd.RunSQL "DROP TABLE tbltracerfinal;"
I then changed it to :
DoCmd.RunSQL "DROP TABLE tbltracerfinal;"
On Error Resume Next
This does not work as VB kicks an SQL error statement before it interprets the next line (ON Error....)
I tried several different versions of SQL code that I thought would work like:
'DoCmd.RunSQL "If (tblTracerfinal) then DROP TABLE tblTracerfinal;"
This has faulty SQL code.
Does anyone know how to check for the existence of a table using SQL in a VBA environment?
OR
Does anyone know how I could do it using VBA code???
Any help would be greatly appreciated. Thanks.