duplex printing with groups - blank page is being counted in numbering

J

jjay

I'm using this for the groups
***********************************************************************************
Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim I As Integer

If (Me.Page Mod 2) = 0 Then
Me.Section(3).Visible = True
End If

If Me.Pages = 0 Then
ReDim Preserve GrpArrayPage(Me.Page + 1)
ReDim Preserve GrpArrayPages(Me.Page + 1)
GrpNameCurrent = Me.[ACCOUNT NUMBER]
If GrpNameCurrent = GrpNamePrevious Then
GrpArrayPage(Me.Page) = GrpArrayPage(Me.Page - 1) + 1
GrpPages = GrpArrayPage(Me.Page)
For I = Me.Page - ((GrpPages) - 1) To Me.Page
GrpArrayPages(I) = GrpPages
Next I
Else
GrpPage = 1
GrpArrayPage(Me.Page) = GrpPage
GrpArrayPages(Me.Page) = GrpPage
End If

Else
Me.ctlgrpPages = "Page" & " " & GrpArrayPage(Me.Page) & " of "
& " " & GrpArrayPages(Me.Page)
End If

GrpNamePrevious = GrpNameCurrent
End Sub
*****************************************************************************


Then this to hide the page break if it is even number of pages
***************************************************************************
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As
Integer)

If (Me.Page Mod 2) = 1 Then
Me.pgBreak.Visible = True
Me.Section(3).Visible = False 'Hide next page header
Else
Me.pgBreak.Visible = False
End If

End Sub
***********************

I also removed the header and footer from being visible on the blank
page.

everything works perfect but my problem is that the blank page is
being counted like "1 of 4" when the 4th is the blank page.

any help is much appreciated.

John
 
Top