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

    Quick printer change for form (Access 2003 winxp sp2)

    I have a form that I normally print. On odd occasions I need to fax it instead. I need simple code to remember the printer specified for the form, be it default printer or a specified one, change it to the desired fax printer and then change it back to the original setting. NOTE: this is a multi-user db and in some instances the normal printer is a specified one in the page layout, not the default one.

    Can someone help me out please?
    "Heading for the deep end"

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

    Re: Quick printer change for form (Access 2003 winxp sp2)

    You should be able to use something like this, assuming that the code runs in the form's code module.

    Dim prt As Printer
    ' Store current printer in variable
    Set prt = Me.Printer
    ' Set printer to fax - substitute the correct name
    Set Me.Printer = Application.Printers("FaxPrinter")
    ' Insert more code here
    ...
    ' Restore original printer
    Set Me.Printer = prt

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

    Re: Quick printer change for form (Access 2003 win

    Thanks Hans, the code works fine.
    "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
  •