Hey!
I need to delete all the controls from a report dynamically, and I've tried the following:
DoCmd.OpenReport "myreport", acViewDesign
Set rpt = Reports![myreport]
Dim c As Control
For Each c In rpt
rpt.DeleteReportControl rpt.name, c.name
Next
and it won't work... the following error appears:
Run-time error: 2465
application-defined or object defined error.
Any idea what i am missing?
I need to delete all the controls from a report dynamically, and I've tried the following:
DoCmd.OpenReport "myreport", acViewDesign
Set rpt = Reports![myreport]
Dim c As Control
For Each c In rpt
rpt.DeleteReportControl rpt.name, c.name
Next
and it won't work... the following error appears:
Run-time error: 2465
application-defined or object defined error.
Any idea what i am missing?