Access Change My Default Printer

  • Thread starter Thread starter Lamar
  • Start date Start date
L

Lamar

I have reports that should print to specific printer. So for those reports I
went into page setup and change it to the specific printer "My Printer".
Problem - Now all the reports in my database have "My Printer" as their
default printer. I do not want this. I only want "My Printer" for reports I
designate as such. For these other reports I want it to print to user's
default printer.

And "My Printer" is not the default printer when I go "Printer and Faxes" on
my computer. At first I did try to use the following code to make the
designated reports print to "My Printer" Do think this is the problem? Any
help is appreciated.

Dim dpfr as Printer
'Set variable to default printer
Set dfpr = Application.Printer
'Set default printer to My Printer
Set Application.Printer = Application.Printers("My Printer")

'Print report
DoCmd.OpenReport stReportName, acNormal
DoCmd.Close acReport, stReportName, acSaveNo

'Set printer back to default printer
Set Application.Printer = dfpr
 
If the users will have the *same* special printer as you, you can open the
report in design view, assign it to a specific printer (on the Page Setup
dialog), and save it. (Note that if you have Access 2007, you must apply the
service packs or this won't work.)

If you want the users to be able to assign their reports to specific
printers, you will need to use an approach like this:
Printer Selection Utility - Users assign printers to reports
at:
http://allenbrowne.com/AppPrintMgt.html
 
Back
Top