Z
zz
Hi,
I am able to refer to a Treeview control on the main form using its
control index in the controls collection of the form; but I can not
refer to it by name. i.e. :
In the load event for the subform:
[ok --->] Set objTvwOnMainForm =
[Forms]![MainFrom].[Form].Controls(0).Object
[NOT ok --->]Set objTvwOnMainForm =
[Forms]![MainFrom].[Form].Controls("tvwExample").Object
With the error message: Run-time error '2465' can't find the field
'tvwExample' refered to in your expression. I have double checked the
name but no expected results.
I have no problem using index but I guess there is something like
"subforms load prior to forms" thing that I don't know and also it is
bad idea the code be index dependent rather than name dependent. So any
insight is appreciated.
Hamid
I am able to refer to a Treeview control on the main form using its
control index in the controls collection of the form; but I can not
refer to it by name. i.e. :
In the load event for the subform:
[ok --->] Set objTvwOnMainForm =
[Forms]![MainFrom].[Form].Controls(0).Object
[NOT ok --->]Set objTvwOnMainForm =
[Forms]![MainFrom].[Form].Controls("tvwExample").Object
With the error message: Run-time error '2465' can't find the field
'tvwExample' refered to in your expression. I have double checked the
name but no expected results.
I have no problem using index but I guess there is something like
"subforms load prior to forms" thing that I don't know and also it is
bad idea the code be index dependent rather than name dependent. So any
insight is appreciated.
Hamid