Subreports and Page Breaks

  • Thread starter Thread starter Karen_H
  • Start date Start date
K

Karen_H

I have a report with several subreports. I wish to break the page before
each subreport, but sometimes Subreport_1 will be empty, so I do not want a
page break.

I have:
Main report
=== (page break object from toolbar)
Subreport_1
=== (page break object from toolbar)
Subreport_2

This works fine if all subreports have data, but sometimes Subreport 1 will
be blank, and if that is the case, I am getting a blank page betweek Main
Report and Subreport 2.

Thank you in advance for your help.
Access 2000 or Access 2002
 
Karen_H said:
I have a report with several subreports. I wish to break the page before
each subreport, but sometimes Subreport_1 will be empty, so I do not want a
page break.

I have:
Main report
=== (page break object from toolbar)
Subreport_1
=== (page break object from toolbar)
Subreport_2

This works fine if all subreports have data, but sometimes Subreport 1 will
be blank, and if that is the case, I am getting a blank page betweek Main
Report and Subreport 2.


Use code in the Format event of the main report section that
contains the subreports. The subreport's HasData property
will tell you if the it's empty or not:

Me.pgBreak1.Visible = Me.subreportcontrol1.Report.HasData
Me.pgBreak2.Visible = Me.subreportcontrol2.Report.HasData
. . .
 
Back
Top