Module:
Function IsTable(DbName As String, TName As String) As Integer
Dim db As Database
Dim Found As Integer
Dim Test As String
Const Name_Not_In_Collection = 3265
Found = False
On Error Resume Next
'If the database name is empty..
If Trim$(DbName) = "" Then 'If db name not specified in function call isTable("",xx)
'...set the db to current db
Set db = CurrentDb()
Else
'otherwise set db to specified open database
Set db = DBEngine.Workspaces(0).OpenDatabase(DbName)
'see if an error occurred
If Err Then
'ONE CAUSE OF BEING HERE IS IF _BE NOT FOUND (MAYBE ON REMOTE PC WITH ONLY FE)
MsgBox "modDTE could not find database to open: " & DbName
IsTable = False
Exit Function
End If
End If
'see if the name is in the Tables collection
Test = db.TableDefs(TName$).Name
If Err <> Name_Not_In_Collection Then Found = True
db.Close
IsTable = Found
End Function
Code to check for table:
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'Specify paths to frontend and backend
Set db = DBEngine.OpenDatabase("C:\NCTCComm\NCTC Subscriber_be.mdb"

'<---SET THIS BEFORE DELIVERING
strPath = "C:\NCTCComm\NCTC Subscriber_be.mdb" '<----------SET THIS BEFORE DELIVERING
strFePath = "C:\NCTCComm\NCTC Subscriber.mdb" '<----------SET THIS BEFORE DELIVERING
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'Link #1 tbl ErrorLog table
If Not IsTable(strFePath, "tbl ErrorLog"

And IsTable(strPath, "tbl ErrorLog"

Then
bSuccess = CreateAttached("tbl ErrorLog", strPath, "tbl ErrorLog"

If bSuccess = True Then
'REM MsgBox "Developer Message #9:" & vbcrlf & vbcrlf &"'tbl ErrorLog' link established.", vbInformation
Else
MsgBox "Attempt to link 'tbl ErrorLog' failed." 'Do something more here???
End If
Else
End If