Leider ist es in MS Access nicht ohne weiteres möglich das Vorhandensein einer Tabelle abzufragen.

Dies wird gerade wenn man mit temporären Tabellen arbeitet zum Problem.

Eine Abhilfe liefert folgende VBA-Funktion:

' check if a table exists
Function tableExists(tableName As String) As Boolean
On Error GoTo Error_tableExists
Dim strTableName
' assign tableName to String
strTableName = CurrentDb.TableDefs(tableName)
' if no error occurs then set tableExists to true
tableExists = True
Exit_tableExists:
On Error Resume Next
Exit Function
Error_tableExists:
Select Case Err.Number
Case 3265 'Item not found in this collection
tableExists = False
Resume Exit_tableExists
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical
Resume Exit_tableExists
End Select
End Function