how to reference subreport in an If-Else statement (or IIF)

H

Home Again

Report name = rptreport card2
Control on report = text61

Subreport name = subrptreportcardcourses
Control on subreport = FinalLG

Both controls are in the Detail section of the form

My statement roughly expressed as IIF is
IIF(text61=4, finalLG.visible=true, finalLG.visible=false)

I'm not sure how to refer to the subreport and the parent report in the
coding
If it were you, what event would you attach this to? (I used form_activate
but detail_format has been suggested)
 
D

Duane Hookom

Why are you mentioning anything about forms when you should be referencing a
report and subreport and their controls?

I would probably use code in the On Format event of the subreport that
contains the control you want to set properties. You can reference the main
report using something like:
Me.Parent.ControlOnParent
if that doesn't work, you can try:
Me.Parent.Report.ControlOnParent

I would think you could some how place the value bound to "text61" in the
record source of the subreport. BTW: "text61" deserves a wrap on the nuckles
for not changing the name to something more descriptive ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top