I connect to my database using :
Set DbsNew = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\LegalTracking"
yet doing this exactly the same way on anothe rproject and calling a recordset exactly the same way yields a "runtime error 13"
at the sql statement.
Public Function chkValidNum(Num As Long) As Boolean
Dim rsCheckNum As Recordset
Dim Checker As Boolean
SQL = "SELECT ContactID " _
& "FROM tblContact " _
& "WHERE tblContact.[ContactId] = " & Num
Set rsCheckNum = DbsNew.OpenRecordset(SQL, dbOpenDynaset)
If Not rsCheckNum.EOF Then
Checker = True
Else
Checker = False
End If
rsCheckNum.Close
Set rsCheckNum = Nothing
chkValidNum = Checker
End Function
Any suggestions at all on how I can fix this as it works in some projects and not in others??
Set DbsNew = DBEngine.Workspaces(0).OpenDatabase(App.Path & "\LegalTracking"
yet doing this exactly the same way on anothe rproject and calling a recordset exactly the same way yields a "runtime error 13"
at the sql statement.
Public Function chkValidNum(Num As Long) As Boolean
Dim rsCheckNum As Recordset
Dim Checker As Boolean
SQL = "SELECT ContactID " _
& "FROM tblContact " _
& "WHERE tblContact.[ContactId] = " & Num
Set rsCheckNum = DbsNew.OpenRecordset(SQL, dbOpenDynaset)
If Not rsCheckNum.EOF Then
Checker = True
Else
Checker = False
End If
rsCheckNum.Close
Set rsCheckNum = Nothing
chkValidNum = Checker
End Function
Any suggestions at all on how I can fix this as it works in some projects and not in others??