I have a report (rptA) with two subreports (srptA1 and srptA2). I have set
the properties of both to 'Can Shrink' including those of the fields shown on
the subreports. The subreports are hidden when the fields are blank.
However when srptA1 is invisible, srptA2 still shows below the space
occupied by srptA1 even though srptA1 is invisible. How can I have srptA2
move up vertically so that a large gap is not left on the report when srptA1
is blank.
Any help would be greatly appreciated. Thanks in advance.
SK
PS: Please note I am an amateur programmer.
There should be no need to hide these subreports (i.e. you should not have
toggle their Visible property.)
1. Open the main report in design view.
2. Right-click the edge of the first subreport control, and make sure its
Can Shrink property is Yes. Repeat for the second one.
3. Click the Section that contains these reports (Detail?), and make sure
the section's Can Shrink is also set to Yes.
4. Make sure the subreports are not overlapping each other, and that no
other control is overlapping them vertically (not even partially beside
them.)
Now, both reports should shrink to zero-height when they have no data, and
the section itself should shrink as well.

Signature
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.
>I have a report (rptA) with two subreports (srptA1 and srptA2). I have set
> the properties of both to 'Can Shrink' including those of the fields shown
[quoted text clipped - 9 lines]
>
> PS: Please note I am an amateur programmer.
S Kahn - 07 Jan 2006 14:47 GMT
Thanks a lot, works great.
SK
> There should be no need to hide these subreports (i.e. you should not have
> toggle their Visible property.)
[quoted text clipped - 27 lines]
> >
> > PS: Please note I am an amateur programmer.
Sietske - 23 Apr 2008 13:23 GMT
Hi all,
How do I hide the label of a subreport when the subreport shows no data?
I've tried using
Me.lblSubreportName.Visible = IsNull(Me.subreportName)
because
Me.lblTextboxName.Visible = IsNull(Me.txtTextboxName)
worked perfectly well for hiding labels of empty textboxes. But it appears
that this method does not work for reports. What could I do to solve this
problem?
John Spencer - 23 Apr 2008 14:27 GMT
Try using the hasdata property of the subreport
Me.lblSubreportName.Visible = Me.subreportName.HasData
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
> Hi all,
>
[quoted text clipped - 11 lines]
> that this method does not work for reports. What could I do to solve this
> problem?
Sietske - 24 Apr 2008 11:47 GMT
Thank you!
> Try using the hasdata property of the subreport
>
[quoted text clipped - 20 lines]
> > that this method does not work for reports. What could I do to solve this
> > problem?
Sietske - 29 Apr 2008 13:17 GMT
In my situation, I needed to add "Report" in the code to get it working:
Me.lblSubreportName.Visible = Me.subreportName.Report.HasData
But it works very well now, thanks again!
> Try using the hasdata property of the subreport
>
[quoted text clipped - 20 lines]
> > that this method does not work for reports. What could I do to solve this
> > problem?