An alternative to my previous post would be, and I quote:
"You don't mention what version\of ms-access.
In access 2002 and later, there is a built in printer object, and it lets
you switch the printer with ease.
You can use:
Set Application.Printer = Application.Printers("HP LaserJet Series II")
So, to save/switch, you can use:
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")
do whatever....print reports
Swtich back.
Set Application.Printer = Application.Printers(strDefaultPrinter)
If you are using a earlier versions, then you can use my lightweight
printer
switch code here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
So, I do often build a form that displays a list of installed printers,
and
allow the user to select a printer. The above code example has such a
form,
but that old example is REALLY only of use for pre-a2002 applications.
So, for special forms, or things like invoice printer, I sill do NOT save
which printer with the report (you *can* save the printer in ms-access,
but
the feature is not much use for users since if they install, or purchase a
new printer..then the name changes..and your application will complain).
So,
while we do switch printers in code..we STILL avoid saving the particular
printer to a given report. So, we always still set reports to use the
default printer.
Since the margins, and portrait/landscape are saved with the report, then
generally, just switching printers should do the trick if we kept the
margins fairly large in the reports.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)
http://www.members.shaw.ca/AlbertKallal "
Hope this helps
Daniel P.