Results 1 to 4 of 4
  1. #1
    weeblesue is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2010
    Location
    Houston, TX
    Posts
    14

    Booklet format printing: Page numbers on alternate sides of page

    I have searched and searched, but can't find an answer for this question. I found one answer that involved swapping margins and that did not work for my situation. All other "alternate page number positions" result in how to change the MARGINS but not the actual page numbering text. I also find many replies for Word, but not Access.



    I have designed a report that will ultimately be printed in booklet format. I have the page numbering in the page footer. I would like the Odd page numbers to appear on the right, and Even page numbers to appear on the left. This way when the whole thing gets printed, the page numbers will be on the outside of the pages, like a real book.

    This has got to be easy, but I can't figure it out.

    Can someone please point me in the right direction?

    Thanks,
    Susan

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Maybe VBA in the report Page section OnFormat event can set the LEFT position or TEXT ALIGN property of the textbox that has the page numbering expression.

    The trick is calculation in VBA to determine if the page number will be even or odd.

    Maybe:

    Me.tbxPage.TextAlign = IIf(Me.tbxPage Mod 2 = 0, "Left", "Right")
    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.

  3. #3
    weeblesue is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2010
    Location
    Houston, TX
    Posts
    14
    My text box is called "PgNum." If I change TbxPage to "PgNum," I get a Type Mismatch error. Run-time error '13'.
    Me.PgNum.TextAlign = IIf(Me.PgNum Mod 2 = 0, "Left", "Right")
    I tried
    Me.PgNum.TextAlign = IIf(Me.Page Mod 2 = 0, "Left", "Right")
    didn't work either.
    In both cases, the default alignment (centered, 2) remained as the value for Me.PgNum.TextAlign.

    I finally found a link to a very old book on VBA programming for Access 2003, and found the code that does what I want. I have 2 text boxes, txtPageEven and txtPageOdd. Odd formatted right justify and Even formatted left justify. I'd rather not have just one box spanning the entire footer.

    The code in PageFooterSection_Format is:
    Code:
    If Me.Page Mod 2 = 0 Then
        ' Display Even page number on right side
        Me.txtPageOdd.Visible = False
        Me.txtPageEven.Visible = True
    Else
        ' Display the Odd page number on left side
        Me.txtPageOdd.Visible = True
        Me.txtPageEven.Visible = False
    End If
    And this works perfectly.

    Thanks for your help, and I hope this helps someone else along the way.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    My first suggestion would not have textbox 'spanning' the entire footer, it would change position of the box. I did not show code for that.

    For the other idea, perhaps needs a numeric constant instead of text for "Left" and "Right" and yes that would mean a textbox spanning the entire footer.

    Ok, 2 textboxes and Visible property is another way.

    Maybe simpler code:

    Me.txtPageOdd.Visible = Me.Page Mod 2 <> 0
    Me.txtPageEven.Visible = Me.Page Mod 2 = 0

    or

    Dim booEven As Boolean
    booEven = Me.Page Mod 2 = 0
    Me.txtPageOdd.Visible = Not booEven
    Me.txtPageEven.Visible = booEven
    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.

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

Similar Threads

  1. Two-Page Report, not printing.
    By bigchicagobob in forum Reports
    Replies: 1
    Last Post: 05-20-2014, 02:41 PM
  2. Replies: 1
    Last Post: 03-05-2013, 06:38 PM
  3. Text Box missing sides when printing
    By ryan.boyle in forum Reports
    Replies: 2
    Last Post: 02-15-2013, 11:08 AM
  4. Replies: 2
    Last Post: 04-18-2012, 03:19 PM
  5. One page report is printing as 666 pages
    By JackieEVSC in forum Reports
    Replies: 3
    Last Post: 12-20-2011, 10:10 AM

Tags for this Thread

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