I created a query to show records already in the database. This way if someone tries to a record with similar entries, it would show an error. In doing so, when I test it out and try to enter a record that does not have like entries, it still gives me the error.
For example if I have a record showing Car 1 Reserved on 1/16/2014 at 3pm-5pm already in the system and I go to enter Car 2 Reserved on 1/17/2014 at 2pm - 4pm it gives me the same error. Here is the code I used.
Code:
Option Compare Database
Private Sub Form_BeforeUpdate(Cancel As Integer)
If DCount("*", "qrydups", "[CHECK-OUT DATE/TIME]= #" & Me.DATE_RESERVED & "# And [CHECK-IN DATE/TIME]=#" & Me.CHECK_IN_DATE_TIME & "# And GV='" & Me.GV & "'") >= 1 Then
MsgBox "Sorry, this GV is taken! Choose another start/end date and time!", , "Double Booking"
Cancel = True
End If
End Sub