G
Guest
I use the following code to check for the existence of a table, and drop it
if True:
Application.RefreshDatabaseWindow
For Each obj In dbs.AllTables
If obj.Name = strTable Then
If obj.IsLoaded = True Then
DoCmd.Close acTable, strTable, acSaveNo
End If
CurrentProject.Connection.Execute _
"DROP TABLE " & strTable
DoEvents
Exit For
End If
Next obj
Why should this be giving me the message, "Cannot drop the table [name],
because it does not exist in the system catalog"? If it didn't exist, the
..Execute line should not have been reached!
if True:
Application.RefreshDatabaseWindow
For Each obj In dbs.AllTables
If obj.Name = strTable Then
If obj.IsLoaded = True Then
DoCmd.Close acTable, strTable, acSaveNo
End If
CurrentProject.Connection.Execute _
"DROP TABLE " & strTable
DoEvents
Exit For
End If
Next obj
Why should this be giving me the message, "Cannot drop the table [name],
because it does not exist in the system catalog"? If it didn't exist, the
..Execute line should not have been reached!