A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Subreports and Page Breaks



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2004, 12:53 AM
Karen_H
external usenet poster
 
Posts: n/a
Default Subreports and Page Breaks

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


  #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]
  #3  
Old May 18th, 2004, 06:39 PM
Karen_H
external usenet poster
 
Posts: n/a
Default Subreports and Page Breaks

You are the greatest! Thank you for a very clear and concise answer!

"Marshall Barton" wrote in message
...
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]



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:20 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.