This function will return a true value if the table exists in the database;
false if not.
Public Function TableIsHere(strTableName As String) As Boolean
Dim tdf As TableDef
TableIsHere = False
For Each tdf in CurrentDb.TableDefs
If tdf.Name = strTableName Then TableIsHere = True
Next tdf
End Function
dim tdf as tabledef
set tdf=nothing
on error resume next
set tdf=dbnow.tabledefs("mywantedtable")
on error goto 0
if tdf is nothing then
'table not found
else
set tdf=nothing 'clear memory
end if
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.