View Single Post
  #2  
Old May 24th, 2010, 04:14 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Hide Sub Report(s) when records are null

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.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Bruce" wrote in message
...
I am running Access 2007 sp2 MSO. I have a report that has three (3) sub
reports. There are times when not all three sub reports have values to
display. Is there a way to code the given report to not be visible if
there
are no records to report? The second part of this question would be if
there
is a way to make the report invisible is it also possible to code so that
the
space where the report would normally reside would not be taken with a
blank
space (the foot print of where the report normally resides)?
--
Bruce