I'm trying to filter a continuous form by a range of dates using start date and end date text boxes. My code just filters everything out even though I have records that should fit the criteria. A potential issue I've noticed (but am unaware of how to resolve) is that my text boxes are formatted "MM/DD/YYYY" and my table field is a datetime format.
Dim datFrom As Date, datTo As Date
datFrom = txtFrom.Value
datTo = txtTo.Value
Debug.Print datFrom
Debug.Print datTo
DoCmd.SetFilter wherecondition:="expFrom BETWEEN #" & datFrom & "# AND #" & datTo & "#"
Debug.Print Format(datFrom, "mmm d yyyy")show you the date you expect? And if you do the same fordatTo? - HansUp"expFrom BETWEEN #" & Format(datFrom, "yyyy-m-d") & "# AND #" & Format(datTo, "yyyy-m-d") & "#"- HansUp