Suppress hard page-break if no data?

D

Dennis

In Access 2003, I've designed a report that has several subreports. Each
subreport is separated by a manually inserted Page Break in the Main report.
In the code for the parent (main) report, I've inserted code that sets two of
the subreports Visible property to False if there is no data in them.
However, the page breaks still force two blank pages to show up (because the
page breaks are in the main report and separate the subreports).

Is there some way I can disable those page breaks if the subreports have no
data?

Any ideas would be greatly appreciated.

Thanks!
 
J

John Spencer

Set the page break controls visible property just like you set the subreports
visible property. If a page break is not visible, then it has no effect.

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

Dennis

When I looked at the Page Break control, I couldn't find a Visible property
associated with it (that was my first thought as well).
 
J

John Spencer

IT does have a visible property. It just does not show up in properties, but
it can be set in VBA

Me.PageBreakName.Visible = False

or

Me.PageBreakName.Visible = True

Try it.

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

Dennis

WOOHOO!!!! That did it! Thanks a million!




John Spencer said:
IT does have a visible property. It just does not show up in properties, but
it can be set in VBA

Me.PageBreakName.Visible = False

or

Me.PageBreakName.Visible = True

Try it.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top