[AccessD] Does table exist?

Jim Lawrence (AccessD) accessd at shaw.ca
Wed Mar 19 16:06:02 CST 2003


Hi Mark:

For older Access97 applications the following code could be used...

Dim db1 As Database
Dim ltabdefTables As TableDef

Set db1 = CurrentDb()
With db1
    For Each ltabdefTables In .TableDefs
        If strDoesthisTableExis = ltabdefTables.Name Then
            TableExists = True
             Exit For
        End if
    Next
End With

... and for current Access applications...

if currentdb.TableDefs(strDoesthisTableExist).Name <> "" Then TableExists =
True

HTH
Jim

 -----Original Message-----
From: accessd-admin at databaseadvisors.com
[mailto:accessd-admin at databaseadvisors.com]On Behalf Of Mark Boyd
Sent: Wednesday, March 19, 2003 9:48 AM
To: AccessD at databaseadvisors.com
Subject: [AccessD] Does table exist?


  Is there code to find out if an Access table exists in the database?



  TIA,

  Mark Boyd

  Sr. Systems Analyst

  McBee Associates, Inc.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030319/67b4da4b/attachment-0001.html>


More information about the AccessD mailing list