Hi
I have split my database moving the tables to SQL. I can open all tables from the front end database, all reports run fine, and forms load the correct data.
I have a problem with a sub which throws an error, There is something wrong in ReturnRecordContents Table = ThisWeeksShifts
Any reports that access the table are correct. I have checked the table in SQL and the index is there
The code is below, has anyone any idea what the problem maybe
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
Dim Response As Integer
Dim TargetTable As String, TargetIndex As String, TargetSearchValue As Long
Dim NoUnmatchedMessage As Boolean, RecordContents As Long
Dim NumberOfFields As Long, TargetSearchValue2 As String
If Date >= Me![DateWeekEndRoutineDueSubform].Form![txtCurrentWeekStartDate] Then
RecordContents = 0
TargetTable = "ThisWeeksShifts"
TargetIndex = "Targets"
TargetSearchValue = 0
TargetSearchValue2 = 0
NumberOfFields = 2
NoUnmatchedMessage = True
RecordContents = ReturnRecordContents(TargetTable, TargetIndex, _
TargetSearchValue, TargetSearchValue2, NumberOfFields, _
NoUnmatchedMessage, "DriverTargetNet", "DriverTargetNetLTD")
If RecordContents <> 8 Then
MsgBox ("Please ensure that all Drivers have been allocated targets")
Exit Sub
End If
End If