An old trick of mine with reports, where field references are needed in the code sheet of the report but not displayed in the report, is to simply create a text-box whose ControlSource is the field of interest and make the control not visible. So, if such a control is created (or left over from an old version of the report) and the field is not included in the RecordSource for the form, one will be prompted for the value when the report opens. My problem is an old report that presumably has some "hidden" controls like I've described here, but I can't find them.
I tried to run this code in the open event:
dim i as integer
for i = 0 to 20
debug.print me.controls(i)
next
Access 2003 does not like the debug statement stating non-supported method. (what's wrong with my code?)
If I can get a list of controls. Is there a way within the report's design mode to delete a control, even if I can't see it?
Thanks,
Bill