Setting Default Printer

G

Guest

I have a database that is split FE/BE and when I do any development on the FE
and copy it over to our production and redistribute it to the desktops I have
a problem where when a person goes to print the first time they get a message
stating the print is set to my default printer not theirs. So will the
following code work to set the app to their default printer and would I put
it in a public function or public sub to run from my autoexec macro.

Dim strDefaultPrinter As String

' get current default printer.
strDefaultPrinter = Application.Printer.DeviceName

'switch to printer of your choice:

'Set Application.Printer = Application.Printers("HP LaserJet Series II")

Set Application.Printer = Application.Printers(strDefaultPrinter)


Thanks

Jim
 
A

Allen Browne

You can avoid this issue if you save the report set up for the default
printer instead of for a specific printer when you develop the report.

In report design view, choose Page Setup on the File menu.
On the Page tab, make sure it is set for Default Printer.

Also, make sure you have large enough margins to cope with the unprintable
area of most printers. A minimum of 0.7" margin all the way around is enough
for most current printers.

If you are wanting to let the user choose one of their printers to send the
report to, and have Access remember to use that printer for them again next
time (regardless of what printers you have on your development machine),
see:
Printer Selection Utility
at:
http://allenbrowne.com/AppPrintMgt.html
 
G

Guest

Perfect,

Thanks Allen
--
Cyberwolf

Finder of Paths, Hunter of Prey
Ghost of the Night, Shadow of Day
The Wolf
 

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