View Single Post
  #3  
Old May 24th, 2010, 01:58 PM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 7,815
Default Hide Sub Report(s) when records are null

You can use the HasData property of the sub-reports to control the visibility
of the sub-report control. In addition, you can set the can shrink property
of the section containing the sub-report control(s) to yes to recover the space.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Allen Browne wrote:
Part 1:
If the main report is bound to a table/query, you can just cancel its
NoData event.

If the main report is unbound (merely a holder for the 3 subreports),
you would need to write some code in the Open event of the report to
DLookup() the 3 source queries for the 3 subreports to see if you get
anything. If you don't, then cancel Report_Open.

Part 2:
Set the CanShrink property to Yes for the subreport control, and also
for the section that holds the subreport.

Provided there is nothing else overlapping the subreport's vertical
space, it will then shrink if it has no data.