0

Ok, I'm a bit of a VBA newb. I have a report that's being generated based on a subreport. That all works fine.

Now I need to add a conditional flag in the subreport to display the main report differently. Ie. if an item in the subreport has a value > 50, I'd like to set a flag for "DispalyAlternateMessage", that would then display a different message than the default on the report. I know how to conditionally show/hide elements in the main report, but what I can't seem to figure out for the life of me is how to pass that conditional value from the sub-report to the main report, or even access the subreport variable from the main report.

Any thoughts/help? Thanks!

nathangiesbrecht
  • 845
  • 12
  • 26

1 Answers1

2

You can refer to a subreport by the name of the subreport control, followed by Report for the item contained, and then the control. For example, you could set the control source of a textbox to:

=[Table1 subreport].[Report].[ATextbox]

Or

=IIf([Table1 subreport].[Report].[ATextbox]=50,"Is 50","Is not 50")
Fionnuala
  • 90,370
  • 7
  • 114
  • 152