Changing printers in Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application that I need to be able to print a report to a pdf file
or to a network printer in Access 2003. The application does so in Access
2000 but in the newer version it doesn't change the default printer.

How do I do this in VB code?
 
DaveK: Since you are in A2003, have you tried this approach?

Application.Printer = Application.Printers("YourPrinterChoice")
DoCmd.OpenReport "YourReportName", acViewNormal
Application.Printer = Nothing

Of course, substitute the printer and report names.

HTH Joe
 
You need to insert Set in front of the two Application.Printer lines:

Set Application.Printer =
Application.Printers("DriverNameOfYourPrinterChoice")
DoCmd.OpenReport "YourReportName", acViewNormal
Set Application.Printer = Nothing
 
Actually, I took the code from one of my applications and it, in fact, works
without the "Set".
 
Ken: Actually, I can't take any credit at all for the format (without the
"Set"). And you guys should be proud of this forum - I got the idea from
here! (see "programming")

Joe
 
Back
Top