Date Range POP-UP

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Hi,

I need your help...

I create a Main Form that has four sub-reports. Each Sub-Report connect to
each query. Each query has "between [from Date] and [To Date]. When I
click the Main Form and it pop up four times "between [from Date] and [To
Date].

I need your help if there is a way to click the Main Form and pop up once
"between [From Date] and [To Date] and able to run all four queries instead
of pop-up four times and generate a report.

thanks
 
Yes, there is a way, but not if you keep the parameters in the queries.
Create a form into which the user enters the dates and construct the queries
in code. Retrieve the queries in the Open event of the Report.

Larry Linson
Microsoft Access MVP
 
Hi,

I need your help...

I create a Main Form that has four sub-reports. Each Sub-Report connect to
each query. Each query has "between [from Date] and [To Date]. When I
click the Main Form and it pop up four times "between [from Date] and [To
Date].

I need your help if there is a way to click the Main Form and pop up once
"between [From Date] and [To Date] and able to run all four queries instead
of pop-up four times and generate a report.

thanks

Regarding....
"A Main Form that has 4 sub-reports?"
and "run all four queries instead of pop-up four times and generate a
report."?

Do you mean you have a form that opens 4 reports, or you have one main
report that has 4 sub-reports? Or a Main Form that opens a report that
has 4 sub-reports?

Make an unbound form in which to enter the parameters.
Add 2 unbound controls.
Name one "FromDate".
Name the other "ToDate"
Set their format property to a valid date format.

Add a command button to this form.
Code it's click event:
Me.Visible = False

Set each query criteria to:
Between forms!FormName!FromDate and forms!FormName!ToDate

Now you need to open this form. Unfortunately it's not clear to me how
you are doing this. Either in the Main Report's Open event, or in a
main Form command button event, code:

Docmd.OpenForm "FormName", , , , , acDialog
Then if this is on a form, open the reports.

Because this form remains open while the reports are run, you will no
longer be prompted for the parameters.

Close this form when all the reports are done.
DoCmd.Close acForm, "FormName"

You can use a report's Close event.
 
If you elimiate the range from the subform queries, it
should still run based on entering the date once from the
main query
 
Back
Top