Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have several Access programs, they're fairly complex, lots of VBA in them and dozens of reports, linked tables, etc. When I print these reports, they don't respect my default printer settings (namely, the duplex option). How can I correct this?

share|improve this question
add comment

2 Answers

you need to set the .UseDefaultPrinter property of the report to True.

From here, this code will reset the printer of all reports to default:

For Each obj In CurrentProject.AllReports
    DoCmd.OpenReport ReportName:=obj.Name, View:=acViewDesign
    If Not Reports(obj.Name).UseDefaultPrinter Then
        Reports(obj.Name).UseDefaultPrinter = True
        DoCmd.Save ObjectType:=acReport, ObjectName:=obj.Name
    End If
    DoCmd.Close
Next obj
share|improve this answer
    
Where should I put this code? In autoexec? –  MAW74656 Aug 28 '12 at 17:39
    
it can be put into autoexec, or as a separate piece of code that can be run at anytime. –  Sean Cheshire Aug 28 '12 at 17:42
add comment

I recently had this exact problem and fixed it by setting the report's .Printer property to the default printer (or desired printer) before printing as below.

'need report open in order to set .Printer property
'  so open report in PREVIEW mode but HIDDEN
DoCmd.OpenReport "<ReportName>", acViewPreview, , , acHidden
'Assign report's .Printer property to default printer
Reports("<ReportName>").Printer = Application.Printers(Printer.DeviceName)
'Print report
DoCmd.OpenReport "<ReportName>", acViewNormal
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.