Results 1 to 2 of 2
2001-08-02, 15:20 #1
- Join Date
- Aug 2001
- Thanked 0 Times in 0 Posts
Determine if Table is present (Access 97 SR-2)
I have a form that allows users to import tables from other databases. Before continuing with additional code, I want to ensure that they imported the correct tables. Is there a way to check, using code, if a table is contained within the database?
2001-08-02, 15:25 #2dave_hillGuest
Re: Determine if Table is present (Access 97 SR-2)
If you know the table names you expect, you can scroll through the TableDefs collection and look for a match.
Dim db as Database, tDef as TableDef
Dim x as Integer, boolFound as Boolean
Set db = CurrentDb
for x = 0 To db.TableDefs.Count -1
Set tDef = db.TableDefs(x)
If tDef.Name = "MyTable" Then
boolFound = True
then use the boolFound value (True or False) to determine your action.