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

    Testing [Pages] no longer works in footer format event

    One of my app's reports previously executing successfully now getting an error.


    Click image for larger version. 

Name:	002.jpg 
Views:	8 
Size:	79.9 KB 
ID:	27684

    The most recent change to the report was the inclusion of a group. If I disable the OnFooterFormat the report displays properly. I don't know what difference a group would make regarding Access' setting of [Pages]. (Me.tbPages is the text-box mentioned in the event code comment.)

    Any ideas?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Instead of the OnFormat event, try the OnPrint event.
    put this as the 1st Line in the sub:

    on error resume next

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    The code below functions correctly in either of the Format OR Print events. The problem was in the reference to the value of a text box, (If Me.Page = Me.tbPages Then). The direct reference to the builtin "Pages" function cleared things up.

    Code:
    Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    ' We only want the report's signature line on the last page.
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
        If Me.Page = Pages Then
            Me.lblSigLine.Visible = True
            Me.lblSignature.Visible = True
        Else
            Me.lblSigLine.Visible = False
            Me.lblSignature.Visible = False
        End If
    
    End Sub

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

Similar Threads

  1. Replies: 4
    Last Post: 12-14-2016, 11:07 AM
  2. Replies: 2
    Last Post: 11-09-2016, 10:42 AM
  3. Replies: 4
    Last Post: 12-30-2015, 10:48 AM
  4. Data entry form no longer works
    By Jamesiv1 in forum Access
    Replies: 1
    Last Post: 05-13-2014, 09:18 PM
  5. Replies: 3
    Last Post: 10-18-2009, 09:17 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