Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Print Order (2000)

    I'm using a command button to print a report. Is there a way in VBA or otherwise to set the printer's "print order" property to "back-to-front"?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Print Order (2000)

    I'm going to get picky here, but what exactly are you asking for help on? For instance, my printer prints the last page first and keeps printing each preceding page on top of that until it prints page 1, so that the pages are in order when I take them off the printer. Does your printer not behave that way, or do you want to print the first page first, or what?
    Charlotte

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Virginia, USA
    Posts
    1,560
    Thanks
    37
    Thanked 1 Time in 1 Post

    Re: Print Order (2000)

    My printer (HP 960c) by default prints pages in ascending order: 1-2-3. The printing preferences dialog box for this machine has a little check box to "Start printing from last page." I suppose that would do the trick, but what you're trying to do would prevent having to reset the printing preferences manually.

    Sorry, but that's all I can contribute to this discussion.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Print Order (2000)

    I don't see an obvious way to do this in code. Neither the PrtDevMode property of the report, nor the new Printer object allow you to set the page order.

    Added later: it is probably printer-specific, not a general Windows setting. There may be an API function for this; if so, someone else will no doubt post the code.

  5. #5
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Print Order (2000)

    Some programs' Print dialogs have options to print pages in reverse order. There appears to be no such option in Access. If determined to do this, you can always print report one page at a time, in reverse order. Example:

    <code>Public Sub PrintReportBackwards(ByRef strRpt As String)</code>

    <code> Dim rpt As Report</code>
    <code> Dim n As Long</code>
    <code> Dim lPages As Long</code>

    <code> DoCmd.OpenReport strRpt, acViewPreview</code>
    <code> Set rpt = Reports(strRpt)</code>
    <code> DoCmd.SelectObject acReport, strRpt</code>

    <code> ' For this to work, report must have textbox or other _</code>
    <code> control that references Pages property. Ex: _</code>
    <code> ="PG " & <!t>[Page]<!/t> & " OF " & <!t>[Pages]<!/t> _</code>
    <code> this forces calculation of page total.</code>
    <code> </code>
    <code> lPages = rpt.Pages</code>

    <code> If lPages > 0 Then</code>
    <code> For n = lPages To 1 Step -1</code>
    <code> DoCmd.PrintOut acPages, n, n</code>
    <code> Next n</code>
    <code> Else</code>
    <code> ' Print normal order:</code>
    <code> DoCmd.PrintOut acPrintAll</code>
    <code> End If</code>

    <code> Set rpt = Nothing</code>

    <code>End Sub</code>

    As noted in comments above, for this to work the report needs to have a control that references the report's Pages property, which forces Access to calculate the total number of pages in report. Of course this means it must format report twice, once to get page count, again to enter Pages total in the control (such as textbox in page footer for page count). Also if using this method the Windows "Printing" dialog will pop up once for each page printed. Another possible option would be to save report in .PDF format (if you have Adobe Acrobat installed); in Acrobat 5.0 Print dialog, you can specify "Reverse Pages" option to print document from back to front.

    HTH

  6. #6
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Print Order (2000)

    Thanks to all who responded. I agree with Hans and others that this is a property of the printer driver and therefore probably not amenable to code changes in VBA. My printer software, as with many, has the ability to select a front-to-back or back-to-front order, but this is not a windows function.

    The one solution I have discovered is to Preview, rather than Print, the report. When the preview comes up I can then go to File|Print and bring up the Print dialog box. From there I can go to the printer properties and select back-to-front order. Not as neat and clean as simply clicking on a Print command button, but it works.

Posting Permissions

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