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

Subreport in Report Footer doesn't display when no data in main report

Status
Not open for further replies.

kellnic79

Programmer
Apr 22, 2005
4
US
Crystal 8.5 VB 6.0 Access 2000

Subreport is linked to ID field of main report.
File-Report Options-Suppress Printing if no records-Option is unchecked.

Tried to play around with different scenerios.
created a formula, inserted a valid ID number in the formula, and placed it on the report. Linked the subreport to the new formula. The subreport still does not display.
The ID I inserted into the formula displays, but not the subreport information.
Data is available in the database table that the subreport is using.

When in preview mode, I can click on the space where the subreport is located, the focus rectangle appears around the report, and I double-click and the subreport opens in preview mode. I can see the information.

I would appreciate any help!
 
I don't understand what you were trying to do!

I created a new report and adjusted the selection criteria for it to make sure that no records would be found.

I then created a sub-report and placed it in the report footer. I DID NOT link it to anything in the main report.

Worked like a charm.

Then I linked it to the main report. Nothing showed up.
Then again, nothing should, because if it's linked, you only get it if you get it's master. That's the way it should be.

You seem to be mixing the two scenarios up, in that you want to link it but don't want it linked, and that's what I don't understand. I would understand linking the sub-report to a report-parameter in this case, but not to report data.

If you right-click on the sub-report display area, you can change the subreport links that are setup.



David Wendelken
 
Subreport is linked to ID field of main report.

Does this mean that the link relies on a table field value from the main report? In such a case, you'd probably get a null value when the report has no detail records.

To get round it, have the subreport get the ID itself. Or if this is not possible, have another subreport in the report header that gets the ID and passes it back using a Shared Variable, and then link on that.


[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
I was testing different scenerios...
I created a formula and assigned a number.This formula would act as a link to the subreport. Even this did not work.

I tried the advice given by SynapseVampire, to make sure that at least "some" data is returned in the main report. This worked.

I understand that no subreport data will be returned when it is linked to a field in the main report, and nothing is returned in the main report. But I could not understand why no subreport data was shown when I linked it too a formula and assigned a value to the formula. In that case, the subreport had a value to use to select its data.

Anyway, thank you SynapseVampire. Your advice worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top