Results 1 to 14 of 14
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Anyway to determine if formatting the last page

    In the OnFormat event of a report, is there statement available to sense "this is the last page"?



    I might be able to solve this issue with the use of page footer versus report footer, but it would be easier with the task at hand if I could just toggle some control visibility in code if I could sense being the last page.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Maybe (like),
    if me.page = me.pages.count then

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,463
    I think it is [Pages] for the total so "if me.page = [Pages] then"

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    In the OnFormat for the footer section:
    Me.Page = Me.Pages.Count wouldn't even compile....... ".count" not valid
    Me.Page = [Pages] never produced a page count in [Pages]

    Thanks for the suggestions, as they in fact led to the ultimate solution.

    My solution:
    Code:
    Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    ' There's a non-visible text box in the footer bound to =[Pages].  The
    ' attempt to reference Me.[Pages] here in code was un-successful.
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    
        If Me.Page = Me!tbPages Then
            Me.lblSigLine.Visible = True
            Me.lblSignature.Visible = True
        End If
    
    End Sub

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    This code works perfectly when viewing "Report Preview", but the printed page or the copy saved to a PDF have the controls previously posted visible on all pages. I'd completely forgotten about the fact that there are two complete formatting passes made on reports.

    Is there any way to sense the difference between the preview pass versus the printing pass?

  6. #6
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    How are you printing it? I tried both the PDF icon as well as Print to pdf and both worked. I am using 2010, maybe that is the difference.

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I tried both the PDF icon as well as Print to pdf and both worked.
    These functions worked for me also, it's just that both methods had the two controls you see posted in my code visible on all pages when printed from the preview. If I suppress preview and go directly to the printer the visibility of the two controls functions according to the code.

  8. #8
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Worked for me! Am I doing it right? I opened the report in print preview, then clicked on the PDF icon at the top. Also clicked Print from there. Also from Report View. I can't seem to duplicate your problem.

  9. #9
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I'll try running the app on A2010 later today to see if I'm up against an A2013 issue.

  10. #10
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Yup - tried and tested - it IS a 2013 thing!

  11. #11
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Added:
    Code:
    Else
        Me.lblSignature.Visible=False

  12. #12
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks. Not sure if or how long it would have been before I thought of what you've done. (Needed to toggle both controls)

    Code:
    Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    ' There's a non-visible text box in the footer bound to =[Pages].  The
    ' attempt to reference Me.[Pages] here in code was un-successful.
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    
        If Me.Page = Me!tbPages Then
            Me.lblSigLine.Visible = True
            Me.lblSignature.Visible = True
        Else
            Me.lblSigLine.Visible = False
            Me.lblSignature.Visible = False
        End If
    
    End Sub

  13. #13
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I wonder if this is a documented difference between 2010 and 2013 - I somehow doubt it!

  14. #14
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I doubt it as well. Maybe one of the MVP's will spot this thread and pass the word along.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-15-2016, 02:14 PM
  2. Report Formatting Page help
    By RayMilhon in forum Reports
    Replies: 5
    Last Post: 08-11-2015, 02:22 PM
  3. formatting Report page
    By joshynaresh in forum Reports
    Replies: 1
    Last Post: 06-23-2014, 02:51 AM
  4. Problem with page formatting on form
    By robertmarkdudley95 in forum Forms
    Replies: 1
    Last Post: 03-30-2012, 03:05 AM
  5. Edit Switchboard Page Formatting Indepently
    By tylerg11 in forum Access
    Replies: 1
    Last Post: 10-06-2011, 02:37 PM

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