With the stupid help MS Access has, I can't find a function to tell me if a particular table exists in the database. I know what table name I'm looking for. Any help here?
Paste this into a module:
Public Function booTableExists(strTableName As String) As Boolean
Dim dbs As Database, tdf As TableDef
booTableExists = False
Set dbs = CurrentDb
For Each tdf In dbs.TableDefs
If tdf.Name = strTableName Then
booTableExists = True
End If
Next
Set dbs = Nothing
End Function
To use the above:
MsgBox booTableExists("Table1"
Obviously, edit the above to your own requirements. Returns True or False.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.