Hi everyone, I need some HEEELLLPPP
I get the above error when I try to run the qrySQL2 query.
What I want to do is: if the date from the TimeCalled field is the same as the date in the TimeOut field then compare that the time from TimeOut is later than the time from the TimeCalled field.
If the date in the TimeOut field is later than the date from the TimeCalled field then do not compare the times.
Both TimeCalled and TimeOut are Date/Time fields and the format is set to General Date.
If anyone can help me it would be greatly appreciated.
Dim qrySQL1 As String
Dim qrySQL2 As String
Dim newValue1 As String
Dim dateTimeOut As Date
If IsNull(TimeOut) Then 'Vehicle is available
newValue1 = "-1"
Else
newValue1 = "0" 'Vehicle is not available
dateTimeOut = Format(Now(), "dd/mm/yyyy ") + Format(TimeOut)
qrySQL1 = "UPDATE tblAppliances SET IsAvailable=" + newValue1 + " WHERE ID=" + Format(Appliance.Value)
qrySQL2 = "UPDATE tblResponse SET TimeOut=" + Format(dateTimeOut) + " Where ID=" + Format(Me.ID)
DoCmd****nSQL (qrySQL1)
DoCmd****nSQL (qrySQL2)
End If
If Date1BeforeDate2(TimeOut, TimeCalled) Then
Exit Sub
End If
If (TimeOut) < (TimeCalled) Then
MsgBox "The TIME OUT is earlier than the TIME CALLED " & vbNewLine & " " & _
vbCrLf & "Please enter the Correct Time. ", vbOKOnly, " Incorrect Time Entered "
Cancel = True
TimeOut.SelStart = 0
TimeOut.SelLength = Len(TimeOut.Text)
End If