Passing a date parameter from a form to a query

  • Thread starter Thread starter Darrell
  • Start date Start date
D

Darrell

I am trying to pass beginning and ending date parameters
from a user-input form to a query on which a report is
based. How do I get the query parameter to understand the
user's input as a date?

Thanks!
 
hope this helps
After you create query and report based on that query you
will need to insert this statement in query under the
Criteria for the Date field that you are trying to filter
out.
Between [forms]![DateRange]![date1] And [forms]!
[DateRange]![date2]
Then simply just create form called DateRange and have two
unbound text boxes (date1 and date2) set format as a short
date and set your input mask if you want.
Add command button on bottom to open that report and you
are all set.
 
I am trying to pass beginning and ending date parameters
from a user-input form to a query on which a report is
based. How do I get the query parameter to understand the
user's input as a date?

Thanks!

Change the query parameter from, for example:
Between [Enter Start Date] and [Enter End Date]
to:
Between forms!FormName!StartDate and forms!FormName!EndDate

where FormName is the actual name of the form, and StartDate and
EndDate are the actual names of the unbound controls on the form.
Note... the form MUST remain open when the query is run.
 
Back
Top