View Single Post
  #2  
Old May 18th, 2004, 05:30 AM
Marshall Barton
external usenet poster
 
Posts: n/a
Default Subreports and Page Breaks

Karen_H wrote:

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
. . .
--
Marsh
MVP [MS Access]