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!

Do not show SUB without data 2

Status
Not open for further replies.

teqtaq

Technical User
Nov 18, 2007
197
US
When you want to subreport not show up if it is blank - what is the best approach?

I set property Can Shrink - Yes but it doesn't help. Thanks
 
If a subreport does not return any records, it generally will not display. Generally posters ask how they can make a subreport display even when there is no data returned in the subreport.

Duane
Hook'D on Access
MS Access MVP
 
I am having a label and subs in the same Report footer.
I see the white space abd think it is because subs showing no data but can be something else, right?

Also can you, please, tell if I have 2 Summary Reports in Report Footer - they should display on last pages - how can I make sure each SUB prints on it's own page and not overlapping another one? Thanks so much
 
Sorry I meant to say
I am having a label and subs in the same GROUP footer.
 
This code in the appropriate Format() event works for me:
Code:
If Me!yourreportname.Report.HasData = 0 Then Cancel = True

Ever notice how fast Windows runs? Me neither.
 
genomon,
I expect your code would cancel the printing of the report section. This might not be the desired outcome.

I'm not sure why you would need any code to hide a report that is not going to display anyway.

Duane
Hook'D on Access
MS Access MVP
 
The code I used was for a subform in a group level, which I wanted completely suppressed if no data. Works OK in footers as well; you're absolutely correct in that it would cancel the entire detail section if placed there. Sorry for the confusion!

Ever notice how fast Windows runs? Me neither.
 
Thanks, your ideas helped me to realize I was doing some things in a wrong way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top