Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Sep 2001
    Location
    Sacramento, California, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Forcing a blank page in report (Access 97)

    I am doing duplex printing of a report and need to force a blank page after the detail section whenever the detail section runs over onto a new page. This will allow the next report to start on it's own page and not on the back of the detail page from the report before. In the Detail_Print event I can find out if we have moved to an odd page. But I can't figure out what code will force a blank page. I have tried

    strEject = Chr(27) & "&10H"
    Me.Print strEject

    That just prints &10H in the detail section.

    Any suggestions?

    Thanks
    Gary

  2. #2
    Lounger
    Join Date
    Dec 2002
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forcing a blank page in report (Access 97)

    Gary,

    You can use

    Detail.ForceNewPage = 1 ' This will force a new page before the Detail section

    or

    Detail.ForceNewPage = 2 ' This will force a new page after the Detail section


    So, you can write

    Private Sub Detail_Format()

    If <condition> = True Then
    Detail.ForceNewPage = 1
    Else
    Detail.ForceNewPage = 0
    End If

    End Sub

    Good luck.

    Shlomo

  3. #3
    New Lounger
    Join Date
    Sep 2001
    Location
    Sacramento, California, USA
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forcing a blank page in report (Access 97)

    Thanks

    I knew there had to be a way to tell Access to insert a blank page, rather than use the printer escape codes that I was trying.

    Gary

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Mishawaka, Indiana, USA
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forcing a blank page in report (Access 97)

    What code did you write to create the <condition>?

  5. #5
    Lounger
    Join Date
    Dec 2002
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forcing a blank page in report (Access 97)

    Tom,

    You can write any valid condition. In case of Gary, he checks whether the current page is odd, so the condition for that would be

    If (Me.Page Mod 2) = 1 Then
    .....

    However, when I wrote the response first, I didn't test it. Now I tested it and found it didn't work exaclty as I anticipated. The first detail section gets printed before a new page is forced. So it looks like something else must be done.

    This is sort of cheat, but if you format the page a bit wider than the page setup allows, it prints a blank page after each normal page. ;-)

    Shlomo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •