Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Posts
    122
    Thanks
    7
    Thanked 0 Times in 0 Posts
    I have a report with page breaks by group. I would like the page number to start over for each group.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

  3. #3
    2 Star Lounger
    Join Date
    Apr 2001
    Posts
    122
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Thanks Hans for the tip and pointer. I read the Access Web information and added the suggested code as an On Format Event for the Page Footer section to my report but I am apparently missing some of the detail syntax:

    I added "=[Me!ctlGrpPages]" to the report footer but Access pops up an "Enter Parameter Value" box when I run the report. I also tried variations such as "=Me!ctlGrpPages" but that did not work either

    I replaced "Me!salesman" with "Me!EBC_Code" but Access doesn't recognize the variable, "Can't find the field" error. EBC_Code is in the list of available fields and it does print in the report footer area with the correct value.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You shouldn't put =Me!ctlGrpPages or a variation thereof in the Control Source of a text box. You should create a text box named ctlGrpPages in the page footer. Leave the Control Source of this text box blank; the code will set the text dynamically.
    Make sure that the text box bound to EBC_Code is named EBC_Code. If it has a different name, you should change the code accordingly.

  5. #5
    2 Star Lounger
    Join Date
    Apr 2001
    Posts
    122
    Thanks
    7
    Thanked 0 Times in 0 Posts
    OK, that cleared up the errors but the page numbering is not printing. I added a statement to set ctlGrpPages = "Test" in the portion of the If Me!Pages = 0 is true loop (first pass) and Test prints so apparently Access is not performing the second pass? COuld this be an Access 7 issue?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Do you mean Access 2007? I can't help with that, I'm still using Access 2002 and 2003. Perhaps someone who has Access 2007 can assist you.

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I tried this code with a db in Access 2007, and it worked OK provided I change

    Code:
    Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)
    to

    Code:
    Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
    and put in the name of the control that I grouped by.
    Regards
    John



  8. #8
    2 Star Lounger
    Join Date
    Apr 2001
    Posts
    122
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Success - thanks to Hans and John. I added the Access standard Page N of M control to the footer and that forced the second pass.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •