I have a report that opens based on the where the office code on the form matches the office code on the report. that works fine.
I have written code that sets the combo box value opens the report (acnormal), then closes report, then sets the combo box value again, opens the report and then close the report.....on and on.
The combo box grows monthly and instead of having to keep updated the code with new office codes, I would like the database to loop through each value of the combo box, print the repot, and then go on to the next one.
Here is the code I am using.
- Dim val As Variant
-
For Each val In Me.ctrlBranchCode
-
-
DoCmd.OpenReport "rptBranchProductionWeekMtdYtd", acNormal, , "[Branch Code] = Forms!frmWeeklyMonthlyReporting!ctrlBranchCode"
-
DoCmd.Close acReport, "rptBranchProductionWeekMtdYtd"
I am gettting an error that says "Object does not support this property or method".
Any help would be greatly appreciated.
A