Search Query Between Dates

Hudas

Registered User.
Local time
Yesterday, 20:30
Joined
May 13, 2013
Messages
55
Hello,

I need help in creating a query using vba. I have a form with FROM and TO textboxes(Formatted as Short Date)....What I'm hoping is:

1. When I put a date in FROM textbox...the query should show records from the date selected onward.
2. When I put a date in TO textbox...the query should show records from the date selected backwards.
3. When I put a date in FROM textbox and TO textbox the query should show data between this two dates?

Hope you can help me...

Thank you
Hudas
 
There may be better ways but this seems to work as the criteria for the date column:
(>=[Forms]![YourForm]![From] Or [Forms]![YourForm]![From] Is Null) And (<=[Forms]![YourForm]![To] Or [Forms]![YourForm]![To] Is Null)
 

Users who are viewing this thread

Back
Top Bottom