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.
Expand|Select|Wrap|Line Numbers
- Dim val As Variant
- For Each val In Me.ctrlBranchCode
- DoCmd.OpenReport "rptBranchProductionWeekMtdYtd", acNormal, , "[Branch Code] = Forms!frmWeeklyMonthlyReporting!ctrlBranchCode"
- DoCmd.Close acReport, "rptBranchProductionWeekMtdYtd"
Any help would be greatly appreciated.
A