You can change the printer in code (a2002-a2003) has a built in printer
object.
(Wayne's link is also a possible..but, it is problem matic since you have to
be able to switch reports into design mode...something you generally want to
avoid.)
As a general rule, I launch the report in view mode, and THEN let the user
print.
So, launch the report, and then go:
On Error Resume Next
DoCmd.SelectObject acReport, Screen.ActiveReport.Name
DoCmd.RunCommand acCmdPrint
The select object command is needed to fix a "focus" bug if you have a form
with a timer function.
In fact, I build a custom menu bar, and use that for all reports.
This also applies for another thing I want to do where I want to print
labels on a shared network printer so I need to be able to immediately
print a single label to (for example) \\PC001\Seikolabel
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 your report...
Swtich back.
Set Application.Printer = Application.Printers(strDefaultPrinter)
If you are using a earlier versions (then 2002), they don't have a printer
swtich object, then you can use my lightweight printer switch code here:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
Also, note that you can "save" what printer to use with a givne reprot, adn
this takes zero code. However, anytme you move hte software, or a printer is
changed/re-installed, then this approach falls down.