Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2010
    Posts
    4

    Red face Syntax error (missing operator) in query expression '23/04/2010 23:37:00'.

    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
    Last edited by Tony Peters; 04-23-10 at 11:09.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •