I have an application with many forms and modules. My tables are stored in the backend and I connect them via links. No problem until the point when I upgraded the two ends to access 2007. Now my TAble exist function does not work it gives the error message "3376 table not found" and I cannot catch the message and go ahead. Help is appreciated. Here is the code:
Code:
Function TableExists(strTableName As String) As Boolean
Dim db As Database
Dim I As Integer
On Error GoTo Err_Handler
TableExists = False
Set db = DBEngine.Workspaces(0).Databases(0)
db.TableDefs.Refresh
For I = 0 To db.TableDefs.count - 1
If strTableName = db.TableDefs(I).Name Then
TableExists = True
Exit For
End If
Next I
TableExists_Exit:
Set db = Nothing
Exit Function
Err_Handler:
Select Case Err.Number
Case 3376
TableExists = False
Resume TableExists_Exit
Case 3265
TableExists = False
Resume TableExists_Exit
Case Else
MsgBox Err.Description, vbExclamation, "Error #: " & Err.Number
Resume TableExists_Exit
End Select
End Function