Double criteria ???

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

Guest

Hi:

I have 2 queries and each of them has a date criteria: between [Start Date]
and [End Date].

I have designed one report based on the first query and a sub-report of this
one based on the second query; the only probelm I have is when I run the
report is asking me to enter twice the date parameter for each; so int otal I
enter the date 4 times instead of twice???

I do not know why?? so if I have the first report and 3 sub reports I will
enter the date 8 times???

Thank you,

Dan
 
Hi:

I have 2 queries and each of them has a date criteria: between [Start Date]
and [End Date].

I have designed one report based on the first query and a sub-report of this
one based on the second query; the only probelm I have is when I run the
report is asking me to enter twice the date parameter for each; so int otal I
enter the date 4 times instead of twice???

I do not know why?? so if I have the first report and 3 sub reports I will
enter the date 8 times???

Thank you,

Dan

Each query requires it's own parameters.
The thing to do is create a form to enter the parameters in.
Leave it open while the reports are tun.
Here is how.

Create an unbound form. Add 2 Text Controls.
Set the Format property to an appropriate Date Format.
Name one StartDate and the 2nd EndDate.

Add a command button.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In each query, in it's Date field's criteria line, 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 display
and wait for the entry of the dates. Click the command button and the
report will run without need for any further parameter entries. When
the report closes, it will close the form.
 
If the parameters are spelled exactly the same, ACCESS should ask for the
parameters just once. Check your spelling, and watch for blank spaces that
are different or the inclusion / omission of a colon, etc.
 
Wait... my just sent reply is not applicable to what you're doing unless the
paramaters are obtained from the controls on a form.

If you don't want to enter the parameters each time, then use a form that
has textboxes on it to enter the queries' parameters, then the report won't
ask at all. Otherwise, if you wish to enter the paramaters manually, then
yes you'll need to enter the parameters each time for the report, for each
subreport, etc.
 
Thank you very much Fred!; I will try...

Dan

fredg said:
Hi:

I have 2 queries and each of them has a date criteria: between [Start Date]
and [End Date].

I have designed one report based on the first query and a sub-report of this
one based on the second query; the only probelm I have is when I run the
report is asking me to enter twice the date parameter for each; so int otal I
enter the date 4 times instead of twice???

I do not know why?? so if I have the first report and 3 sub reports I will
enter the date 8 times???

Thank you,

Dan

Each query requires it's own parameters.
The thing to do is create a form to enter the parameters in.
Leave it open while the reports are tun.
Here is how.

Create an unbound form. Add 2 Text Controls.
Set the Format property to an appropriate Date Format.
Name one StartDate and the 2nd EndDate.

Add a command button.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In each query, in it's Date field's criteria line, 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 display
and wait for the entry of the dates. Click the command button and the
report will run without need for any further parameter entries. When
the report closes, it will close the form.
 
THANKS A LOT FRED! it is working GREAT!!!

Thanks everyone!

Dan

fredg said:
Hi:

I have 2 queries and each of them has a date criteria: between [Start Date]
and [End Date].

I have designed one report based on the first query and a sub-report of this
one based on the second query; the only probelm I have is when I run the
report is asking me to enter twice the date parameter for each; so int otal I
enter the date 4 times instead of twice???

I do not know why?? so if I have the first report and 3 sub reports I will
enter the date 8 times???

Thank you,

Dan

Each query requires it's own parameters.
The thing to do is create a form to enter the parameters in.
Leave it open while the reports are tun.
Here is how.

Create an unbound form. Add 2 Text Controls.
Set the Format property to an appropriate Date Format.
Name one StartDate and the 2nd EndDate.

Add a command button.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In each query, in it's Date field's criteria line, 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 display
and wait for the entry of the dates. Click the command button and the
report will run without need for any further parameter entries. When
the report closes, it will close the form.
 
Back
Top