Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Report Sub-form

Status
Not open for further replies.

FXP

Programmer
Sep 17, 2004
135
US
I was given a report that uses a sub-form in the Footer. I would like to load a different report footer sub-form based on information in the data record. I put the code in the Report/Open event. I am getting an "Error 2474 - The control you entered requires the control in the active window." Is their a different place to put the code? It is a simple if test that selects the sub-form based on a boolean value in the record. Thanks in advance for all and any advice.
 
Hello:

That error means that your form is presently not the active form. There is something in front of it.
'
In your code, try setting focus to the form first.
Regards
Mark
 
Thanks, I will take another look when I go back to work after the July 4th Holiday.
 
Actually, I believe a maneouvre like that,
may require your report to be in design view?

Docmd.openReport "rptsale", acViewDesign, acHidden'(check order of args)
Reports!rptSales!srptVaries.Report.ControlSource = _
"srptOther"
Docmd.Selectobject acReport, "rptSale" 'put back to normal view, & visible (I believe)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top