jen7392
06-05-2014, 12:46 PM
Every day I have to print a set of 5 reports. I wanted to create a macro to print all of them at once. I used the Wizard in Access 2010 to build it. Then I had it converted to Visual Basic because I figured I would need to add the duplex part in that way. So, after it was converted, here is the code:
'------------------------------------------------------------
' PrintReports
'
'------------------------------------------------------------
Function PrintReports()
On Error GoTo PrintReports_Err
DoCmd.OpenReport "1 - Credit Card Rejected Transaction", acViewNormal, "", "", acNormal
DoCmd.OpenReport "2 - Credit Card Cleared Transactions", acViewNormal, "", "", acNormal
DoCmd.OpenReport "3 - Credit Card Outstanding Transactions (2)", acViewNormal, "", "", acNormal
DoCmd.OpenReport "4 - Honored But Not Recorded Listing", acViewNormal, "", "", acNormal
DoCmd.OpenReport "5 - eComplish Cleared Daily Total", acViewNormal, "", "", acNormal
PrintReports_Exit:
Exit Function
PrintReports_Err:
MsgBox Error$
Resume PrintReports_Exit
End Function
I have my default printer setting set to "Two-sided printing", but for some reason that does not carry through to reports in Access. When printing the reports individually, I have to go to properties and set that option. Any help I would greatly appreciate.
Thanks!!
'------------------------------------------------------------
' PrintReports
'
'------------------------------------------------------------
Function PrintReports()
On Error GoTo PrintReports_Err
DoCmd.OpenReport "1 - Credit Card Rejected Transaction", acViewNormal, "", "", acNormal
DoCmd.OpenReport "2 - Credit Card Cleared Transactions", acViewNormal, "", "", acNormal
DoCmd.OpenReport "3 - Credit Card Outstanding Transactions (2)", acViewNormal, "", "", acNormal
DoCmd.OpenReport "4 - Honored But Not Recorded Listing", acViewNormal, "", "", acNormal
DoCmd.OpenReport "5 - eComplish Cleared Daily Total", acViewNormal, "", "", acNormal
PrintReports_Exit:
Exit Function
PrintReports_Err:
MsgBox Error$
Resume PrintReports_Exit
End Function
I have my default printer setting set to "Two-sided printing", but for some reason that does not carry through to reports in Access. When printing the reports individually, I have to go to properties and set that option. Any help I would greatly appreciate.
Thanks!!