Hello, I am running into some troubles with my vehicle check-out database. I've created a form for members to enter in their info and reserve a vehicle. Then I get the following error:
Syntax error (missing operator) in query expression "DATERESERVED=' 12/14/2013 8:00AM" And CHECKINDATETIME=#' 12/14/2013 10:00AM And GV=#G14-52005#'.
My code is:And this line is highlighted in yellow with an arrowOption Compare Database
Private Sub Command19_Click()
If DCount("*", "qrydups", "'DATERESERVED='" & Me.DATE_RESERVED & "' And CHECKINDATETIME=#'" & Me.CHECK_IN_DATE_TIME & "' And GV=#'" & Me.GV & "#") > 0 Then
MsgBox "This GV is available! Click Print Confirmation", , "GV Available"
Else
MsgBox "Sorry, this GV is taken! Choose another start/end date and time!", , "Double Booking"
End If
Exit_Command138_Click:
Exit Sub
Err_Command138_Click:
MsgBox Err.Description
Resume Exit_Command138_Click
End Sub
If DCount("*", "qrydups", "'DATERESERVED='" & Me.DATE_RESERVED & "' And CHECKINDATETIME=#'" & Me.CHECK_IN_DATE_TIME & "' And GV=#'" & Me.GV & "#") > 0 Then
Please help.
Also would this be the correct way to stop double booking? Any help would be greatly appreciated. Warning you are dealing with a noobie.