Results 1 to 8 of 8
  1. #1
    pocans is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    10

    Hidden labels on screen are not hidden when printing

    So I was having issues with report/page footers not showing up how I wanted them. I wanted a few items on all the pages and on the last page some extra information. What I ended up doing was placing everything in the page footer and making the extra information set to visible = false. Then on the last page I would set the extra information to true. In the format property of the page footer looked like the code bellow.

    if page = me.pages then
    me.item1.visible = true
    me.item2.visible = true


    end if

    so in the example above item1 and item2 is set to visible = false. if page = me.pages(or the last page of the document) item1 and item2 are now visible. The results on screen are perfect. item1 and item2 only show up on the footer of the last page. The results are fine on print preview also. But when I print the page Item1 and Item2 are showing up on all of the pages.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    did you put this code in the ON PRINT event?

  3. #3
    pocans is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    10
    Yes, I have tried adding the code to the ON PRINT event and get the same result.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    i use this all the time, and it works.
    try:

    me.item1.visible = page = me.pages

  5. #5
    pocans is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    10
    would this be only in the on print event?

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Just to be sure....

    Code:
    Me.item1.visible = False
    Me.item2.visible = False
    
    if Me.Page = Me.Pages then
       Me.item1.visible = true
       Me.item2.visible = true
    end if
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    pocans is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2018
    Posts
    10
    I solved the issue. I had to add an else on my if statement and set everything back to false for visibility. What was happening was when the form loaded and got to the last page it turned the specific information to visible = true. At that point when the report was printed the information that was set to visible = true and it does not go back to its default visible = false. There was nothing I had to add in print property. Bellow is what I had to alter to get it to work in the format property of the page footer.

    if page = me.pages then
    me.item1.visible = true
    me.item2.visible = true
    else
    me.item1.visible = false
    me.item2.visible = false
    end if

    Thank You for everyone's help.

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Just to say that my solution was just a variation of yours.
    Always specify the visible state using one or other approach
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 1
    Last Post: 12-27-2016, 07:49 AM
  2. Printing Excel from Access (Excel Hidden)
    By Snayjay in forum Programming
    Replies: 3
    Last Post: 03-22-2014, 01:57 PM
  3. Hidden Duplicates Still Printing
    By ColbyDog in forum Reports
    Replies: 1
    Last Post: 01-21-2013, 04:38 PM
  4. Replies: 0
    Last Post: 01-18-2011, 07:09 AM
  5. Hidden Attributes
    By NMJones in forum Access
    Replies: 1
    Last Post: 02-09-2010, 10:57 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