I have placed several unlinked subreports in an unbound report's Report Header. Each subreport has two subreports. I'm trying to get the value of the Top property of the first of these sub-subreports, but I'm getting inconsistent results. The reference I'm (currently) using in the OnLoad event of the main report is:
This works perfectly when I switch from Design View to Print View, but I get a runtime error (2455: the expression "has an invalid reference to the property Form/Report") when I open the report from the navigation pane. Why would there be a difference between these two actions?
I've tried different variations to no avail. What do I need to do to make it work consistently? At what point would nested subreport properties be available to the parent report?
(I'm using Access 2010 on Windows 10 Pro)
Code:
intSubSubTop = Me.Controls(strSub1).Report.Controls(strSubSub1).Top
This works perfectly when I switch from Design View to Print View, but I get a runtime error (2455: the expression "has an invalid reference to the property Form/Report") when I open the report from the navigation pane. Why would there be a difference between these two actions?
I've tried different variations to no avail. What do I need to do to make it work consistently? At what point would nested subreport properties be available to the parent report?
(I'm using Access 2010 on Windows 10 Pro)