This probably won't work as you expect.
Firstly, reports are forward-scrolling datasets only. That means you can't
assign a value after it has gone past the event, the you generally want to
assign the value in the Format event of the section that contains the
unbound control. You could therefore use the Format event of the section in
the subreport to assign the value.
Report_Open is too early to assign a value. Also, the subreport is opened
prior to the main report, so the main report's Open event is not suitable.
Further, the subreport is instantiated multiple times if there are multiple
records in the main report that need the subreport.
If the Format event of the section in the subreport is not suitable, you
could use the Format event of the section on the main report that contains
the subreport. You could then assign your value to an invisible text box on
the main report, and just have the subreport read that value, i.e. set the
Control Source of the subreport text box to something like this:
=[Parent]![YourHiddenTextbox]
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
message
news:
[email protected]...