resetting page n of M in report

I am trying to reset the page numbers on a report each time the name changes.
I have searched the knowledge base and found the following link
http://www.mvps.org/access/reports/rpt0013.htm
but, being a novice, I have not been able to figure out how to use it.
I could use some patience and detailed explanation on how to make this work.
This is the following code I am trying to use:

Option Compare Database

Option Explicit

Dim GrpArrayPage(), GrpArrayPages()
Dim GrpNameCurrent As Variant, GrpNamePrevious As Variant
Dim GrpPage As Integer, GrpPages As Integer

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)
Dim i As Integer
  If Me.Pages = 0 Then
    ReDim Preserve GrpArrayPage(Me.Page + 1)
    ReDim Preserve GrpArrayPages(Me.Page + 1)
    GrpNameCurrent = Me!GroupHeader0
    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 = "Group Page " & GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)
  End If
  GrpNamePrevious = GrpNameCurrent
End Sub

I am not real sure where to put what ?????  I tried to find an example db using this but was unsuccessful
ssblueAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
this is simpler

How to reset the page number on a group level in an Access report

http://support.microsoft.com/kb/209215/

http://support.microsoft.com/default.aspx?scid=kb;en-us;841779
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<I am not real sure where to put what ?????  >>

  The second MSKB article cap posted will give you the step by step.  The difference between the two is that the first only gives you a page number (x) and the second gives you the page number over the group (x of y).

 in the code you picked up, which uses the same technique as the MSKB article basically.  The code gets pasted into the reports module.  It goes here:

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)

  the page footer.  The code is assuming that your page control is called ctlGrpPages.

HTH,
JimD
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Note that one major difference between what cap posted and the code you picked up is that the latter uses an array instead of a table to store the page for each group.  it's also a little tighter code wise with everything on one procedure.

JimD
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

ssblueAuthor Commented:
I had seen the microsoft examples but didn't really want to use them -- but I could.
I really would like to figure out the array.  I have text box in the page footer that is called ctlGrpPages but it still doesn't want  to work??  
I want to re number on my Exr1Header which is called GroupHeader0
0
Rey Obrero (Capricorn1)Commented:
ssblue,

if you really want to use the array..

zip your db and upload here www.ee-stuff.com

0
ssblueAuthor Commented:
0
ssblueAuthor Commented:
The report we are looking at is

Individ_All_CrossTabRpt
0
Rey Obrero (Capricorn1)Commented:
ok,  at first look

place the codes in  

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


end sub


change

GrpNameCurrent = Me!GroupHeader0

to

GrpNameCurrent = Me.Expr1
0
Rey Obrero (Capricorn1)Commented:
also change

CtlGrpPage

to

CtlGrpPages

and remove the control source  ="Page " & [Page] & " of " & [Pages]
0
ssblueAuthor Commented:
Did that but now it is like one report pages 1 of 65 and I lost my groupings??
0
ssblueAuthor Commented:
Still not working right????
0
ssblueAuthor Commented:
Well that is working, however, on a 3 page group it is showing
Group page 1 of 1
Group page 2 of 2
Group page 3 of 3
instead of
Group page 1 of 3
Group page 2 of 3
Group page 3 of 3
0
ssblueAuthor Commented:
Thanks for the help -- even though we didn't get there.  I have something that will work and now I know and understand more.  Thanks again!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.