Changing printer for a form

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
 
M

Martin

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
 
J

Jack Leach

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top