Access 2007 Sending Prints to Wrong Printer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sphinney
    New Member
    • Mar 2007
    • 69

    Access 2007 Sending Prints to Wrong Printer

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

    Code:
    DoCmd.OpenReport RPT_NAME, acViewPreview, , , , ARGS
    DoCmd.RunCommand acCmdQuickPrint
    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.

    Code:
    Set Application.Printer = Application.Printers(0)
    Does anyone understand what Access is doing? Am I missing something?

    Thanks for the help.
    sphinney
  • mshmyob
    Recognized Expert Contributor
    • Jan 2008
    • 903

    #2
    try setting your default printer like so and let me know if it helps.

    [code=vb]
    Dim strDefaultPrint er As String
    ' get current default printer.
    strDefaultPrint er = Application.Pri nter.DeviceName
    ' set to the printer
    Set Application.Pri nter = Application.Pri nters(strDefaul tPrinter)
    [/code]

    cheers,

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

    Code:
    DoCmd.OpenReport RPT_NAME, acViewPreview, , , , ARGS
    DoCmd.RunCommand acCmdQuickPrint
    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.

    Code:
    Set Application.Printer = Application.Printers(0)
    Does anyone understand what Access is doing? Am I missing something?

    Thanks for the help.
    sphinney

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      There is a bug in 2007 that prevents the assigning of a specific printer that Microsoft has issued a hotfix for:



      Linq ;0)>

      Comment

      Working...