Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Programatically adjust printer settings (A97 sr2)

    Hi all,

    We have a printer with two trays: tray1= letterhead, tray2= plain paper

    We create Delivery dockets by printing a form onto plain paper and Invoices by printing onto the letterhead. This is set in each form and works well.

    I have been asked, is it able to print 2 copies of each invoice, 1 on letterhead, 1 on plain.

    I have a button on the form that causes the "print current record" procedure. Is there code that can be added to the button to cause the printer to change paper tray and then print another copy?

    I assume that the next time the form is opened, the printer will default to the values saved in the form.

    Thinking about it, I should be able to address the current printer object and make the changes I want.
    If this is true, Can someone spell (type) out for me in short and simple words how exactly to do this please.
    "Heading for the deep end"

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Programatically adjust printer settings (A97 sr2)

    I would create two printers in windows, one with default plain paper and one with default letterhead.
    Make two identical report, but with specific printer (in the page setup dialog) , one with the letterhead printer and one with the plain paper printer. This is saved with the report. Print the two reports one after they other with 2 Docmd.OpenReport.
    There is no way to control the printer until you buy Office XP, witch had a Printer Object, but I haven't see it yet and I don't know if you can manipulate trays with it.
    Francois

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Programatically adjust printer settings (A97 sr2)

    There is a way to programatically set the Printer settings, although I have never taken the time to make it work properly.

    It's called PrtDevMode - you can search Access help for it or look at the MSKB Articles Q200546. The first article has a link to a great <A target="_blank" HREF=http://www.microsoft.com/AccessDev/Articles/GetzCh10.HTM>article by Ken Getz</A>.

    Access 2002 (XP) has these seetings placed into nice easy properties, but it's essentially doing the same thing that the PrtDevMode settings did in earlier versions.

    HTH <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Altnau, Thurgau, Switzerland
    Posts
    447
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Programatically adjust printer settings (A97 sr2)

    Francois, look at the PrtDevMode. One can perform all sorts of manipulation with that, however it is not very easy to use. I have used it with Access 97 and above.

  5. #5
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Programatically adjust printer settings (A97 sr2)

    Here is some code that I had "stashed" in my folder of things I might need one day. I have not actually tested it but maybe you can adapt it to your use.

    Option Compare Database
    Option Explicit

    Const R_UPPER_TRAY = 1
    Const R_LOWER_TRAY = 2

    Type R_DevModeStr
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

  6. #6
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: Programatically adjust printer settings (A97 sr2)

    Back from a few days away, thanks for the code snippet Ricky, I will attempt to try and make sense of it and see if I can make it work.
    "Heading for the deep end"

Posting Permissions

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