Changing printer for a form

  • Thread starter Thread starter Confused Slug
  • Start date Start date
C

Confused Slug

For a particular form i wish to set a specific printer for the 'printout'.
The printer i wish to select is on a network so the index may change on each
computer but the name of the printer is the same. After the form has been
printed i wish the printer to be returned to the default printer for each
desktop.

How can this be coded?


Thanks
 
I’d try with this:

Dim dfpr As Printer

Set dfpr=Application.Printer ‘Gets the current default printer
Set Application.Printer=Application.Printers(“your printer nameâ€) ‘Sets the
default printer to the desired one
‘Your code here
Set Application.Printer=dfpr ‘resets default printer back before finishing
 
Note that his Printer object is only available in versions 2002 and later.
If you are using 2000 or previous this is much more difficult. Search
mvps.org/access for "prtdev" for more information.


--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
 
Back
Top