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

Linking Subreports With Parameters

Status
Not open for further replies.

rickj65

Programmer
Jun 5, 2002
79
US
I have 2 subreports that I've placed on a main report. Both subreports use date range parameters for filtering data.

The main report has no data source. I'm just using the main report as a shell for displaying the results of the 2 subreports.

When I run the subreports individually, the data comes out fine. However, when I try to run the main report so I can display the results of both subreports on one report, no data is returned.

I have the subreports linked to the main report by the date parameters that I'm passing.

Is there something that I'm missing here?

TIA,
Rick
 
If no data exists in the main report, the subs won't fire.

You can cheat this by doing a simple select in the main report (select top 1 from table) and suppressing the results.

-k
 
OK, I'm not using any record source on the main report (was having some problems there). However, I got the subreport records to print out correctly.

My problem now is that the report is asking me for the same parameters 3 times (once for the main report, once for one subreport and once for the other subreport).

Any ideas on how to get this to passing the parameters just once from the main form and populating the 2 subs with those parameters?

Thanks,
Rick
 
You need to create the same date parameter in the Main report and in both sub reports then, link the sub reports to the main report via the date parameter(s). I have had this problem in the past and for some reeason the parameters would not link until I placed the sub report date parameters on the sub reports somewhere.
 
I created identical parameters (startDate) in the main and subreport and placed them on the respective reports. When selecting "Change subreport links", I select "?startDate" from the Available-Fields and transfered it to Field-to-link-to.
It shows up in the Subreport-parameter-field-to-use but there is no equivalent selection available in the drop down to the right.
When I OK it to save and then retrieve it, the selection was not really saved.

Please advice
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top