=========
QUESTION
———
In Microsoft Access 2007, using VBA, how can you check to see if a table exists?
=========
EXAMPLES
———
On Error Resume Next
———
Public Function dbsTableDelete(DBName)
Count = 0
tblNotFound = False
Do Until tblNotFound
If DBName = dbs2020.TableDefs(Count).Name Then
dbs2020.TableDefs.Delete (DBName)
Exit function
End If
Count = Count + 1
‘Determine if we are at the very end of the table listing or not,
‘if we are then the table wasn’t found,
‘end the Do loop and exit the function
If dbs2020.TableDefs.Count = Count Then
tblNotFound = True
End If
Loop
End Function
———
=========
REF
———
http://www.tek-tips.com/viewthread.cfm?qid=933401
=========
APPLIES TO / KEYWORDS
———
Microsoft Access
VBA
—
http://www.anysitesupport.com/vba-check-if-table-exists/