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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to count Number of pages in a Group

Status
Not open for further replies.

dixxy

Technical User
Mar 4, 2003
220
CA
Hello,

I am trying to figure out a way of counting the number of pages in a group in a Report. My Report gets broken up into 3 groups which can have more than one sheet. I would like to show the group header on the first page of each group, and the page header on the following pages of each group.

Based on this value if the group has more than one page I will be able to show or hide the Group Header.

Is there a way to count the number of pages in a group?

I have tried the code posted here but it doesn't work.


Thanks,

Sylvain
 
Try setting a module level flag (mblnNewGroup) as = True in the Group Header _Print and = False in the Group Footer _Print. If you don't have a footer already, add one and set it to not visible.

If the flag is true, you reached the header, but not the footer, so you're on the same group. In the _Print section you can't change the format, but you can cancel the printing of the section by setting the automatic Cancel variable to false.

In the Header_Print:
Cancel = mblnNewGroup
mblnNewGroup = True

In the Footer_Print:
mblnNewGroup = False


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top