Link to home
Start Free TrialLog in
Avatar of murdochah
murdochah

asked on

Delete Control from Report with VBA

Is there any way to delete controls from a report programmatically with VBA?  I'm building a dynamic report that creates new textboxes, but I want to make sure that I clean up and delete previous iterations before adding the new textboxes.  I'm aware of the apparently undocumented "DeleteControl" method for forms.  Is there something similar for reports?
ASKER CERTIFIED SOLUTION
Avatar of shanesuebsahakarn
shanesuebsahakarn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stevbe
stevbe

If you just change the .Visible property then you don't have to open in design and save. I run into this kind of thing because I deploy to a runtime environment only.

Steve
True, but I think murdochah is doing this to clean up a report design rather than dynamically altering the report on the fly. I'm not sure what his circumstances are though.
Avatar of murdochah

ASKER

I got it to work properly, my only question is this:  does the DeleteReportControl method show up in your copy of the Access Help documentation?  I couldn't find it in the help so I'm wondering if it's undocumented, or if my Access Help documentation has gotten corrupted somehow.  

Thanks for the help!
Andrew
It's in my help doc - I'm using Access 2002.