Tyler said:
Is there a way to carry a user provided parameter across
multiple queries that use the same parameter. Would only
like to enter a date range once across multiple queries.
Tyler,
Make an unbound form with whatever unbound text controls you will need.
Add a Command Button to the form.
Code it's Click event:
Me.Visible = False
Name this form 'frmDates'.
Let's say you have 2 controls on the form, one named StartDate the other
EndDate.
In each query, change the criteria of the DateField to read:
Between forms!frmDates!StartDate AND forms!frmDates!EndDate
When you need to run the queries, open this form first.
Enter the dates, click the command button.
Run the queries.
Remember to close the form when done.
As long as the form is open, each query will get the parameters from it.
Something like this is often done when running multiple reports that all
need the same parameters. If that is your intention, open the form in
the first reports Open event:
DoCmd.OpenForm "frmDates", , , , , acDialog
Then close it in the final report's Close event:
DoCmd.Close acForm, "frmDates"
Now the opening and closing of the form is automatic.