Parameters in subreports

V

Vince

I have a report with 3 subreports. Each subreport uses
the same parameter. How can I pass the input parameter
from one subreport to the next, so the user will not have
to input the parameter 3 times?

Thanks.
 
A

Allen Browne

Simplest solution is to get the queries to read the value from a form.

Create a form with a text box, where the user can enter the value. In the
Criteria row of each query under the appropriate field, enter:
[Forms]![MyForm]![MyTextBox]

It is a good idea to declare these parameters in the query, so it
understands the data type. For example, if this is a date, in query design
view choose Parameters on the Query menu, and enter:
[Forms]![MyForm]![MyTextBox] Date/Time
It also helps to set the Format property of the text box to Short Date (or
General Number or whatever).
 
V

Vince

Thanks, Allen. I'm trying to do that but running into
problems. I will keep trying, following your suggestions
and the Help page "Use a form to enter report criteria".

Does it matter that my main report is unbound?

And will this input date persevere until the entire report
(and subreports) is completed?

-----Original Message-----
Simplest solution is to get the queries to read the value from a form.

Create a form with a text box, where the user can enter the value. In the
Criteria row of each query under the appropriate field, enter:
[Forms]![MyForm]![MyTextBox]

It is a good idea to declare these parameters in the query, so it
understands the data type. For example, if this is a date, in query design
view choose Parameters on the Query menu, and enter:
[Forms]![MyForm]![MyTextBox] Date/Time
It also helps to set the Format property of the text box to Short Date (or
General Number or whatever).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a report with 3 subreports. Each subreport uses
the same parameter. How can I pass the input parameter
from one subreport to the next, so the user will not have
to input the parameter 3 times?

Thanks.


.
 
V

Vince

Thanks again! It is now working, and I can proceed with
the project.
-----Original Message-----
Simplest solution is to get the queries to read the value from a form.

Create a form with a text box, where the user can enter the value. In the
Criteria row of each query under the appropriate field, enter:
[Forms]![MyForm]![MyTextBox]

It is a good idea to declare these parameters in the query, so it
understands the data type. For example, if this is a date, in query design
view choose Parameters on the Query menu, and enter:
[Forms]![MyForm]![MyTextBox] Date/Time
It also helps to set the Format property of the text box to Short Date (or
General Number or whatever).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a report with 3 subreports. Each subreport uses
the same parameter. How can I pass the input parameter
from one subreport to the next, so the user will not have
to input the parameter 3 times?

Thanks.


.
 
S

Savvoulidis Iordanis

Yes, but what happens when the same report can be opened from two different
forms ?
 
D

Duane Hookom

You open the form invisible and place values into the controls that are
required.
 
Top