parameters for report

  • Thread starter Thread starter Pam
  • Start date Start date
P

Pam

I have report which shows total payroll per contract, and
a graph to show how it divides up between contracts. I
have a parameter to ask for the beginning date for the
report. Everything works fine, except with the graph on
the page it asks for the begining date twice. If you
remove the graph, it only asks for the date once. How can
I get it to ask for the date once, and use for the graph
also?
TIA-
 
I have report which shows total payroll per contract, and
a graph to show how it divides up between contracts. I
have a parameter to ask for the beginning date for the
report. Everything works fine, except with the graph on
the page it asks for the begining date twice. If you
remove the graph, it only asks for the date once. How can
I get it to ask for the date once, and use for the graph
also?
TIA-

Instead of entering your parameter in the query, use a form.

Make an unbound form.
Add a control.
Set it's Format property to a Date format.
Name this control "FromDate"
Add a command button.
Code it's Click event:
Me.Visible = False
Name this form "ParamForm"

Change the query criteria from:
[Enter Start Date]
to
forms!ParamForm!FromDate

Code the open event of the Report:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the Close event of the Report:
DoCmd.Close acForm, "ParamForm"

Open the Report.
The report opens the form.
Enter the date in the control.
The Report will run, the graph will display.
When the report closes, it will close the form.
You will not get any prompts.
 
Back
Top