Hi
I have a form with an unbound text box for the user to insert a date that will filter all records with this date, but it is not working. The code is based on someone else's code used for a similar function which does work, I just need to make it work in this instance and cannot for the life of me figure out why it won't do what it is supposed to do!
Any help anyone can offer would great. Here is the code:
Private Sub ArrDateSearch_Exit(Cancel As Integer)
' Search for booking using arrival date after exit
If IsNull(ArrDateSearch) Then
GoTo Exit_ArrDateSearch_Exit
Else
On Error GoTo SearchError_Click
Me.Filter = "[Arrival Date] =" & Me.ArrDateSearch
Me.FilterOn = True
Me.Requery
Exit_ArrDateSearch_Exit:
Exit Sub
SearchError_Click:
MsgBox "Insert a valid date"
Resume Exit_ArrDateSearch_Exit
End If
End Sub
The result is that it returns no records, even when I know there are records with the same date input.
I have a form with an unbound text box for the user to insert a date that will filter all records with this date, but it is not working. The code is based on someone else's code used for a similar function which does work, I just need to make it work in this instance and cannot for the life of me figure out why it won't do what it is supposed to do!
Any help anyone can offer would great. Here is the code:
Private Sub ArrDateSearch_Exit(Cancel As Integer)
' Search for booking using arrival date after exit
If IsNull(ArrDateSearch) Then
GoTo Exit_ArrDateSearch_Exit
Else
On Error GoTo SearchError_Click
Me.Filter = "[Arrival Date] =" & Me.ArrDateSearch
Me.FilterOn = True
Me.Requery
Exit_ArrDateSearch_Exit:
Exit Sub
SearchError_Click:
MsgBox "Insert a valid date"
Resume Exit_ArrDateSearch_Exit
End If
End Sub
The result is that it returns no records, even when I know there are records with the same date input.