Parameters for multiple queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to use two seperate queries to produce information on a report
in an ADP. Both are parameter querys (functions) and the criteria is the same
but because the information is different I cannot seem to integrate the
queries as one. Is there a way I can enter the parameters just once and
produce the results for both in my report. The one report is the main and the
other is a subreport. Also is this a function of the report or the queries?
 
I would like to use two seperate queries to produce information on a report
in an ADP. Both are parameter querys (functions) and the criteria is the same
but because the information is different I cannot seem to integrate the
queries as one. Is there a way I can enter the parameters just once and
produce the results for both in my report. The one report is the main and the
other is a subreport. Also is this a function of the report or the queries?

Create an unbound form.

Add 2 unbound text controls.
Set their format to a valid date format.
Name them "StartDate" and "EndDate"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

As criteria in each query's date field write:
Between forms!Paramform!StartDate and forms!ParamForm!EndDate

Next, code the Main report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the Main report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates wanted.
Click the command button and then report will run.
When the report closes, it will close the form.

Since the sub-report uses the same parameters, you won't have to enter
them again.
 
will this work on an ADP page? I keep getting errors when trying to enter
these expressions in the designer.
 
Back
Top