-----Original Message-----
Hi. Here is my current setup. I have a query that pulls
the range entered, then have a macro to print out 5
reports based on this one query. However when each report
prints, the reports themselves again ask for a range and I
need to re-enter. This gets tedious entering for all 5.
Is there a way to have the range selected, then print out
reports based on that range without yet again prompting
for a range?
Any help is appreciated.
Thanks.
You are using Macros.
I'll assume you do know how to write an event procedure.
Post back if you do not.
I'll also assume, that the 'Range entered' is a Date range.
Use a form to enter the parameter values.
Create a new unbound form.
Add 2 unbound text controls.
Name one "StartDate"
Name the other "EndDate"
Set each control's format property to a Date format.
Add a Command button to the form.
Code it's Click event:
Me.Visible = False
Name this form "ParamForm".
Change the query parameters from something like
Between [Start Date] and [End Date]
to:
Between forms!ParamForm!StartDate and forms!ParamForm! EndDate
Code each report's Open Event:
If Not IsLoaded("ParamForm") Then
DoCmd.OpenForm "ParamForm", , , , , acDialog
End If
If there is always one report that is the final one printed, code that
report's Close event:
DoCmd.Close acForm, "ParamForm"
Otherwise you'll need to manually close the form after the last report
has been printed.
When you start printing, the first report will open the ParamForm.
Enter the starting and ending dates.
Click the command button.
The Report will print. When the next report is run, since the form is
still open (though hidden), the parameters will be available to the
query and you will not be prompted again.
The last report will close the form (if you have coded it to do so).
--
Fred
Please reply only to this newsgroup.
I do not reply to personal e-mail.
.