Results 1 to 15 of 15
  1. #1
    Join Date
    Mar 2004
    Posts
    287

    Unanswered: Printing to different Trays

    Is there a way to print a report to different print trays, preferably via VB code or by setting it up on the actual report settings?

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    It depends on the printer. If you have a printer with multiple trays and the printer driver allows you to, then you should be able to do it with File/Page Setup for the report. The key is to use a Specific Printer.

    The drawback to using Specific Printer is that the settings will only work for that named printer. If you have the same printer setup on different systems with different names, Access will give you a message stating that the report was designed for PrinterA and PrinterA does not exist on this computer and would you like to reformat it for PrinterB?

    I use the Page Setup alot because I know all of our printers are setup with the same driver and name.

    I have not done it, but I believe you have some limited ability with the Printer object if you want to go the VB route.

  3. #3
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    See the Printer property in the help file. It's just the thing.

    Sam

  4. #4
    Join Date
    Mar 2004
    Posts
    287
    but how do i do this in the vb script as the user in question has limited knowledge of using computers and i want to make it an easy one button process for them?

    I can set it to a default or particdular printer, although now i reliase i require even pages on letter (tray 2), and odd pages on grey (tray 3)

    any suggestions please? I need to get this done by the end of today if possible.

  5. #5
    Join Date
    Mar 2004
    Posts
    287
    or even better to print odd pages or evens to different trays!?

  6. #6
    Join Date
    Mar 2004
    Posts
    287
    can anyone help with this please?

  7. #7
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Chances are that each tray is driven by a different driver. Look in your Print dialog box to determine the driver name (or location) for each tray. Then you might say:

    Code:
    Dim T2 as Printer, T3 as Printer
    Set T2 = "The driver name for tray 2"
    Set T3 = "The driver name for tray 3"
    Because Access' dialog box doesn't allow for direct odd/even sequencing, you simply use the Mod function.
    Code:
    If Me.Page Mod 2 = 1 then    'Current page is odd number
        Me.Printer = T3
    Else    'Even page
        Me.Printer = T2
    End If
    Put this code into the report's Page Header section, and try it out with a short (two-page) report.


    HTH,
    Sam

  8. #8
    Join Date
    Mar 2004
    Posts
    287
    many thanks will try this and let you know.

  9. #9
    Join Date
    Mar 2004
    Posts
    287
    what do you mean place in report header of the report. not in the VB???
    I was going to put all the code above under "Report_Page()"
    Is this wrong? where else would it go?

    And the print driver? Look in your Print dialog box to determine the driver name (or location) for each tray.
    What do you mean. The actual driver, where would i find the driver for the tray???

  10. #10
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    The code - which is one continuum by the way - should go in the report's VBA PageHeaderSection() print event.

    The actual driver is not what you need. You only need to identify it to Access so Access will find it and pick it up. Look in the File-->Print dialog box. All your printers are identified there. In actuality, of course, they aren't the printers at all - those are sitting on your desk - they're only the drivers. Whatever it says there is what you should use as the setting for T2 and T3 in my code snippet. If the driver is identified in the Print dialog box as "The grey paper tray of the printer on Nick's desk", then that is the setting, as in:
    Code:
    Set T2 = "The grey paper tray of the printer on Nick's desk"
    Access will find the actual driver from there.

    I'm not sure I answered your questions, but I tried my best.

    Sam

  11. #11
    Join Date
    Mar 2004
    Posts
    287
    i;m sorry but i'm stuck on your reply - what do you mean when you say the grey paper tray on nicks desk... etc etc
    I have printer PPR15 how do i find the names of the seperate trays? would they be defaulted to tray1, tray2, etc...

  12. #12
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    These are the printer names in your print dialog box. PPR15 is an example. When you click on File-->Print, the dialog box appears, and all your printer names show, either in a combo box or a window, depending on the application. If you want one of a set of trays to be active, you need to have a driver pointing to that tray. Ergo, if you have a multi-tray printer with different color paper in each tray, and you want your app to pick different trays programatically (as opposed to you going in there manually and picking out a tray), you have to install the printer driver X number of times, with each one pointing to a different tray. (Here at work, for example, we have a 4-tray network printer with its driver installed 4 times, and the driver is named in a user-friendly manner; ThePinkTray, TheWhiteTray, etc.) Each driver is set to permanently default to a particular tray. That's the only way I know to do it. In your program, then, set T2 and T3 to different drivers and keep changing the .Printer property from = T2 to = T3.

    HTH,
    Sam

  13. #13
    Join Date
    Mar 2004
    Posts
    287
    ah i get what you mean now. multiple instances of drivers for different trays... but is there a way to program this into the vb with using just one driver and different trays on THAT driver rather than duplicate drivers?

  14. #14
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Quote Originally Posted by NeilMansell
    ah i get what you mean now. multiple instances of drivers for different trays... but is there a way to program this into the vb with using just one driver and different trays on THAT driver rather than duplicate drivers?
    Not to my knowledge.

    Sam

  15. #15
    Join Date
    Mar 2004
    Posts
    287
    ok thanks anyway, i will try your method first which may work for now.
    many thanks for all the help!

Posting Permissions

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