Query to find out if a table exists in the database???
Not sure about that.
I just use a little function I wrote to check for this type of thing.
Just copy/paste into a new standard module.
Is this what you are looking for?
Public Function funcTableExists(strTable As String) As Boolean
On Error GoTo ErrorPoint
' Jeff Conrad - Access Junkie
' © 2004 Conrad Systems Development
' This function will check to see if a table exists within
' the current database.
' Must have reference set to DAO object library
' Similar to IsLoaded function it will return True or False
' Call like so:
' If funcTableExists("TableNameHere") = True Then
' ' Table Exists
' Else
' ' Table does not exist
' End If
Dim db As DAO.Database
Dim doc As DAO.Document
Set db = CurrentDb()
With db.Containers!Tables
For Each doc In .Documents
If doc.Name = strTable Then
funcTableExists = True
End If
Next doc
End With
ExitPoint:
On Error Resume Next
Set db = Nothing
Exit Function
ErrorPoint:
MsgBox "The following error has occurred:" _
& vbNewLine & "Error Number: " & Err.Number _
& vbNewLine & "Error Description: " & Err.Description _
, vbExclamation, "Unexpected Error"
Resume ExitPoint
End Function