Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared data source via parameter

Status
Not open for further replies.

griffter

Programmer
Oct 17, 2005
36
GB
Hi. I have a main report and I am considering using on demand subreports to give the user the ability to run several reports from one area and share parameters and variables between them.

If I link to a database in the main report will I need to prompt the user evertime they open one of the subreports to set a parameter in the SQL query to obtain the right datasource or can I make it so the subreport uses the same parameter as the main report in the SQL query?

Any guidance would be helpful.
 
You can pass a parameter value to the subreports from the main report using Edit menu -> subreport links.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Assuming that you have the parameter defined in the main report, let's say it is {?period}.

Then you can create the same parameter in the subreport, and add it to your subreport record selection formula, and then link the two parameters together, using Change Subreport Links.

In the subreport links screen, be sure to use the dropdown in the lower left hand corner to select {?period}, not the default {?pm-?period}.

This will allow the main report selected parameter value to be passed to the subreport.

Simply repeat this process for any additional subreports.

-------------------------------------------------------

This is my updated version of an answer I originally got from "lbass", when I had a similar question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top