Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Welcome to the skill header Forums. You can ask questions, get help, or help other members out. Join our Forum for free.
Hi, Please help me with the Date filter. It filters correctly in some dates but sometimes it doesn't and sometimes it shows empty result. Attached is the screenshot showing 0 records and below are the code.
Dim strSearch As String
strSearch = "[DateOfTransaction] Between #" & Me.txtDtFrom & "# and #" & Me.txtDtTo & "#"
Me.Form.Filter = strSearch
Me.Form.FilterOn = True
If you could post the entire vba code for your “Search Between” button. It might provide more insight
It seems that you are using Date format (dd/mm/yyyy) other than standard. Specify the format for both dates in your code. Like this:
strSearch = "[DateOfTransaction] Between #" & Format(Me.txtDtFrom, "dd/mm/yyyy") & "# and #" & Format(Me.txtDtTo, "dd/mm/yyyy") & "#"
My suggestion is to change your system's default regional format to "English (United States)" if you want to avoid complex date structure and formatting in each vba code. By using this method, your code should work as it is.
Nice catch! Shamefully, I did not see that.