cricketbird
Registered User.
- Local time
- Today, 09:20
- Joined
- Jun 17, 2013
- Messages
- 108
I'm trying to create a setting that cycles through all my reports and changes them all to A4 (or vice versa to Letter).
The following code almost works, but I can't seem to refer to the reports correctly. What am I missing?
I've also tried
The following code almost works, but I can't seem to refer to the reports correctly. What am I missing?
Code:
Public Sub UpdateReportPageSize(pSize As Integer)
' 1 = Letter; 9 = A4
Dim rpt As Object
For Each rpt In Application.CurrentProject.AllReports
Debug.Print rpt.Name
DoCmd.OpenReport rpt.Name, acViewDesign
Reports(rpt.Printer.paperSize) = pSize
DoCmd.Close acReport, rpt.Name
Next
End Sub
I've also tried
Reports!rpt.Printer.paperSize
and saving the whole thing as a string, but no luck.