frmListOfOrders (based on qryListOfOrders) has unbound StartDate and EndDate text boxes and search button btnSearch .
The search sub is:
The btnSearch code is:
I enter StartDate and EndDate (say, 09\01\2020 and 09\30\2020), click on the btnSearch - the result is records from 09\01\2020 to09\29\2020 (the last date of the interval omitted, as if it was coded <EndDate instead of <=EndDate. There are records dated 09\30\2020, though.
What do I miss?
The search sub is:
Code:
Sub Search()
Dim strCriteria, task As String
strCriteria = "OrderDate between " & Format(Me.StartDate, "\#mm\/dd\/yyyy\#") & " and " & Format(Me.EndDate, "\#mm\/dd\/yyyy\#")
task = "select * from qryListOfOrders where (" & strCriteria & ")"
DoCmd.ApplyFilter task
End Sub
Code:
Private Sub btnSearch_Click()
Call Search
End Sub
I enter StartDate and EndDate (say, 09\01\2020 and 09\30\2020), click on the btnSearch - the result is records from 09\01\2020 to09\29\2020 (the last date of the interval omitted, as if it was coded <EndDate instead of <=EndDate. There are records dated 09\30\2020, though.
What do I miss?