Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page brake after group, conditionally 1

Status
Not open for further replies.

Blorf

Programmer
Dec 30, 2003
1,608
0
0
US
Hi. I have a report with several groups. I have the force new page set to yes for after each group. The problem is that on occasion, a group may be empty and have nothing to print. I want it to not force a page if the group is blank.

Is there a way, with either vba or just settings to tell it to behave that way?


Thanks,


"When religion and politics ride in the same cart...the whirlwind follows."
Frank Herbert
 
This may be of no help, but I was thinking of putting some code in the format of the group header... it would go something like this:

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
Dim intGetVal As Integer
intGetVal = Reports![reportname].Section(acHeader).ForceNewPage
IIF([fieldinheader] is null,intGetVal = 0, intGetVal = -1)
End Sub

misscrf

Management is doing things right, leadership is doing the right things
 
Perfect.

The sections include sub reports, so a little tweak, but the code works!

I appreciate your help,
ChaZ

"When religion and politics ride in the same cart...the whirlwind follows."
Frank Herbert
 
Awesome!!! I love it when I actually can help someone!
hehehe

misscrf

Management is doing things right, leadership is doing the right things
 
Through label report wizard I could create reports and sort them based on field1, field2 ,field3, field4 and field5

How do I force a new page after every new field3 ?

Can I know how the pagebreaks were achieved based on grouping? Is it a setting or do I need to code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top