By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Access 2007 Sending Prints to Wrong Printer

P: 69
OK, is Access 2007 driving anyone else nuts? I've got three lines of VBA code that sends a report to the printer:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport RPT_NAME, acViewPreview, , , , ARGS
  2. DoCmd.RunCommand acCmdQuickPrint
  3. DoCmd.Close acReport, RPT_NAME, acSaveNo
These lines worked perfectly in Access 2003. Now with 2007, the report is being sent to the wrong printer. I don't understand why Access 2007 has choosen the particular printer it's sending the reports to. The printer the reports are going to is not the current printer in Access, nor is it the default printer for the computer.

I tried inserting the following line at the beginning to force the report to go to the default printer, but this has had no effect. The reports are still going to the same wrong printer.

Expand|Select|Wrap|Line Numbers
  1. Set Application.Printer = Application.Printers(0)
Does anyone understand what Access is doing? Am I missing something?

Thanks for the help.
sphinney
Jun 3 '08 #1
Share this Question
Share on Google+
2 Replies


mshmyob
Expert 100+
P: 903
try setting your default printer like so and let me know if it helps.

Expand|Select|Wrap|Line Numbers
  1. Dim strDefaultPrinter  As String
  2. ' get current default printer.
  3. strDefaultPrinter = Application.Printer.DeviceName
  4. ' set to the printer
  5. Set Application.Printer = Application.Printers(strDefaultPrinter)
  6.  
cheers,

OK, is Access 2007 driving anyone else nuts? I've got three lines of VBA code that sends a report to the printer:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport RPT_NAME, acViewPreview, , , , ARGS
  2. DoCmd.RunCommand acCmdQuickPrint
  3. DoCmd.Close acReport, RPT_NAME, acSaveNo
These lines worked perfectly in Access 2003. Now with 2007, the report is being sent to the wrong printer. I don't understand why Access 2007 has choosen the particular printer it's sending the reports to. The printer the reports are going to is not the current printer in Access, nor is it the default printer for the computer.

I tried inserting the following line at the beginning to force the report to go to the default printer, but this has had no effect. The reports are still going to the same wrong printer.

Expand|Select|Wrap|Line Numbers
  1. Set Application.Printer = Application.Printers(0)
Does anyone understand what Access is doing? Am I missing something?

Thanks for the help.
sphinney
Jun 3 '08 #2

missinglinq
Expert 2.5K+
P: 3,532
There is a bug in 2007 that prevents the assigning of a specific printer that Microsoft has issued a hotfix for:

http://support.microsoft.com/kb/950488

Linq ;0)>
Jun 3 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.