Checking to see if a table exists

  • Thread starter Thread starter PC Datasheet
  • Start date Start date
P

PC Datasheet

Dave,

Go back to the developer documentation. TableExists is a user-defined function.
You need to get the code for this function and insert it in a standard module.
 
I need to check if a table exists - I tried using the following from the
developer documentation

If TableExists("tbl_MemberControls") = False Then Do Whatever

But got a compile error - what am I doinfg wrong



Thanks
 
Easy to do - using documented methods instead of undocumented ones, GS!
:-)

(untested)

dim bExists as boolean, s as string
on error resume next
s = dbengine(0)(0).tabledefs("tbl_MemberControls").name
bExists = (err.number = 0)
on error goto 0
' now bExsists is True if the table exists, False otherwise.

HTH,
TC
 
Back
Top