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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter field in subreport

Status
Not open for further replies.

skiabox

Technical User
Aug 27, 2002
125
0
0
GR
I have inserted a subreport to a report.The subreport is a separate report that is not linked to the parent report.
I am using a parameter date field at the parent report that asks the user the date.
Basically the subreport is a copy of the parent report with one extra table.
The problem is that when the report runs it asks now for 2 date parameter fields one for each report.Is there any way I can use the parameter date field of the parent report to the subreport without having it asking for date again?
Thank you!
 
Right click on the subreport and click on Change subreport links.

Select the parameter ([?]ParameterName) from the main report you want pass to the subreport

uncheck "select data in subreport based on field"

From the dropdown on the left select the parameter name without the ?Pm- prefix.

Click OK

that should do it.

-lw
 
ok.I've done these steps.I am using ?Date in the detail section of the subreport and in some record selection formulas again in the subreport.Should I change these things?
 
You're welcome! Just passing on a tip that lbass showed me a while back.

-lw
 
I have this exact problem. I have start and end dates in my main report and start and end dates in my sub report with the user having to enter two sets of dates in the parameters. I've gotten to the change links screen, chosen the start date from my main report, unchecked the "select data based on field box", but the drop-down on the left has only two choices. The first is "?Pm ?Startdate" and the second is "Parameter Fields". There's a blank line between. There is no parameter without the ?Pm. What am I missing? Any help would be hugely appreciated.
 
Make sure the parameters in the subreport are of the same datatype as in the main report, e.g., that both are datetime or both are date.

-LB
 
Thanks. That was the problem. I meant to check this way back when the subreport was being developed and totally forgot about it. Sometimes you can't see the forest for the trees.
 
I want to use that parameter that is passed to the subreport as a record selection condition the same way that I use it for the main report.
Is this possible?
 
Just go into the record selection formula of the subreport, and adjust the automatically generated formula to meet your needs.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top