Table Recognition

  • Thread starter Thread starter Charlie
  • Start date Start date
C

Charlie

How can I determine if a table exists programically? I
want to make sure a table exists before deleting it.
 
Using the application object
dn catching the error

for ADP
Application.CurrentProject.AllForms.Item(<Form_Name>).Name

for MDB
Application.CurrentDB.AllForms.Item(<Form_Name>).Name
 
I agree with the rest just delete the table and continue on
with any other processing. Here is some code example

Private sub.......
On Error Resume Next

DoCmd.DeleteObject acTable, "tablename1"
DoCmd.DeleteObject acTable, "tablename2"

' Insert your other processing needs

Update_Data_Exit:
Exit Function

Update_Data_Err:
MsgBox Error$
Resume Update_Data_Exit

ens sub

Jim
 
Back
Top