Subreports and Parameters

G

Guest

I have designed three reports, one shows the pressure over 7 days, one shows
the flow rate over 7 days, and the third shows the gallons pumped over 7
days.

I have put each of these reports into a single report as three sub-reports,
the problem is that each report asks for a data range parameter. Is there a
way to open the report and not enter the date range parameters three times?
 
G

Guest

sure......off the cuff - - -one way is to create a 'Report Opener'
Form.....where you put in the data range in that form and with a button that
then opens your form(s)...

on your forms; you replace the date range data with instead a pointer to
the form!formname.datebox entry so they refer to that form's date info.....
 
G

Guest

I guess this WOULD work but these are reports not forms, and they are all
subreports on a "main" report.
 
G

Guest

right....but that doesn't prevent you from presenting this form first as part
of the report opening....for the sole purpose of harvesting that date info...

perhaps it is not as elegant as one may wish but in many cases Reports are
dependent on specific criteria...and the way to harvest that criteria and
plug it into the query so that the Report contains what the user wants - - -
- is to first start with a Form....
 
S

Steve Schapel

Larry,

Each of the three subreports is presumably based on a query, and in this
case a paramater query, where the user is prompted to enter the date
range required or whatever. So, as NTC suggested, if you had a form
open at the time the report is printed, with the required dates entered
into unbound textboxes on the form, then you can replace the parameter
prompts in the query with criteria that directly references the controls
on the form. You haven't given any specific information, but this
criteria might end up looking something like this...
Between [Forms]![NameOfForm]![DateFrom] And [Forms]![NameOfForm]![DateTo]
or...
Between [Forms]![NameOfForm]![EndDate]-7 And
[Forms]![NameOfForm]![EndDate]

This way, you will only need to enter the date criteria once, i.e. on
the form, and the queries for all 3 subreports will use it.
 
G

Guest

Thanks Steve THAT made it clear what I need to do!
--
Never give up, the answer IS out there, it just takes a while to find it
sometimes!


Steve Schapel said:
Larry,

Each of the three subreports is presumably based on a query, and in this
case a paramater query, where the user is prompted to enter the date
range required or whatever. So, as NTC suggested, if you had a form
open at the time the report is printed, with the required dates entered
into unbound textboxes on the form, then you can replace the parameter
prompts in the query with criteria that directly references the controls
on the form. You haven't given any specific information, but this
criteria might end up looking something like this...
Between [Forms]![NameOfForm]![DateFrom] And [Forms]![NameOfForm]![DateTo]
or...
Between [Forms]![NameOfForm]![EndDate]-7 And
[Forms]![NameOfForm]![EndDate]

This way, you will only need to enter the date criteria once, i.e. on
the form, and the queries for all 3 subreports will use it.

--
Steve Schapel, Microsoft Access MVP
I guess this WOULD work but these are reports not forms, and they are all
subreports on a "main" report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top