Checking if Table exists

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Client Database on a Laptop which has a Macro to link to the Master
Database on a server.

A table is created in the Client Database only if it can connect to the
Master Database. I want the Macro to exit (StopMacro) if the Table doesnt
exist or if there is no connection to the Master Database.

Is there a Macro command to check if it can connect to the Master Database
or if the Table exists (Table only exists while this Macro is running)?
 
I'll add this first: Get away from Macros and into VBA. There are
many things that you can not do in Macros, and even in 2007, it is
still preferrable to work solely in VBA.

That said, use this as the condition to the macro:

Not IsNull(DLookUp("Name","MSYSOBJECTS","Name='Table1'"))

Replace Table1 with the name of the table For the action, use
StopMacro.



Chris Nebinger
 
Back
Top