Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Looks like you got the code into the report code module.



    You need to select [Event Procedure] in the PageFooter section OnFormat event property.

    You don't call this code. PageFooterSection_Format is an event procedure. Just open report in PrintPreview and Format events will run.

    Format events only run when report opened in PrintPreview or direct to printer, not ReportView.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    griztkojr is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    30
    Quote Originally Posted by June7 View Post
    Looks like you got the code into the report code module.

    You need to select [Event Procedure] in the PageFooter section OnFormat event property.

    You don't call this code. PageFooterSection_Format is an event procedure. Just open report in PrintPreview and Format events will run.

    Format events only run when report opened in PrintPreview or direct to printer, not ReportView.
    Thank you June7! You are always very helpful. The txtbox is coming up empty. I think i have to put something on the control source but dont know what. It is the variables, GrpPage and GrpPages?

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    The line:

    Me!ctlGrpPages = "Group Page " & GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)

    is supposed to set value into textbox. So no, do not set the ControlSource property for this textbox.

    I had to insert a report page numbering textbox then the code populates ctlGrpPages. From report design ribbon, click on Page Numbers and select 'Page N of M'.

    I find that if there are controls in Report footer and the group is set to force a new page after the group footer, the report and last group will have an extra page in their page counts.

    Have you set group section to force new page after the group footer?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #19
    griztkojr is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    30
    Quote Originally Posted by June7 View Post
    The line:

    Me!ctlGrpPages = "Group Page " & GrpArrayPage(Me.Page) & " of " & GrpArrayPages(Me.Page)

    is supposed to set value into textbox. So no, do not set the ControlSource property for this textbox.

    I had to insert a report page numbering textbox then the code populates ctlGrpPages. From report design ribbon, click on Page Numbers and select 'Page N of M'.

    I find that if there are controls in Report footer and the group is set to force a new page after the group footer, the report and last group will have an extra page in their page counts.

    Have you set group section to force new page after the group footer?
    It worked!! Thank you, Thank you!!. I did set to force a new page after the group footer.

  5. #20
    griztkojr is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    30
    Quote Originally Posted by griztkojr View Post
    It worked!! Thank you, Thank you!!. I did set to force a new page after the group footer.
    For some reason its not counting properly. A group that is suppose to be be three pages is only showing 1 of 1 for each page.

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I don't have data and report that can test for multi-page groups. If you want to provide your db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Running Module with Macro
    By cm-net in forum Macros
    Replies: 2
    Last Post: 01-20-2018, 08:04 AM
  2. Replies: 3
    Last Post: 02-10-2014, 10:21 AM
  3. Replies: 14
    Last Post: 01-31-2012, 09:53 AM
  4. Running a module
    By KevinMCB in forum Modules
    Replies: 2
    Last Post: 03-09-2011, 02:38 PM
  5. Running module from Macro
    By Harley Guy in forum Modules
    Replies: 6
    Last Post: 10-27-2010, 11:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums