G
Guest
Please could someone tell me what I'm doing wrong here. It keeps telling me
that the "For" statement can't handle a report object...?
Public Function SetRptPaper()
Dim ctr As Container, rpt As Report, db As Database
Set db = CurrentDb
Set ctr = db.Containers!Reports
For Each rpt In ctr
DoCmd.OpenReport rpt, A_DESIGN
If Not Reports(rpt).Printer.PaperSize <> acPRPSA4 Then
SetPrinter rpt.Name
DoCmd.Close A_REPORT, rpt, acSaveYes
End If
Next
End Function
Please, any help would be appreciated
that the "For" statement can't handle a report object...?
Public Function SetRptPaper()
Dim ctr As Container, rpt As Report, db As Database
Set db = CurrentDb
Set ctr = db.Containers!Reports
For Each rpt In ctr
DoCmd.OpenReport rpt, A_DESIGN
If Not Reports(rpt).Printer.PaperSize <> acPRPSA4 Then
SetPrinter rpt.Name
DoCmd.Close A_REPORT, rpt, acSaveYes
End If
Next
End Function
Please, any help would be appreciated