Reference a control on a subform that is on a subform

  • Thread starter Thread starter gsnidow via AccessMonster.com
  • Start date Start date
G

gsnidow via AccessMonster.com

Greetings. What is the syntax for making reference to a control on a subform
that is on a subform. Thanks to Marshall, I got this to work for the first
sub

Forms!Parent.Child.form!Control

Now, what I am trying to do is make reference to a control on a subform that
is also on a subform. So I tried this

Forms!Parent.Child1.form.Child2.form!Control.

Of course, it does not work. So is this even possible?

Greg
 
Greg,

I got it to work this way maybe it will help you on your way..


Forms!mainformname.subformname.Form.subsubformname.Form.Controls.Item("field")

where mainformname = the name of your main form
subformname = the name of your subform
subsubformname = the name of the subform on your subform
field= the fieldname you want to reference..

hth
 
Actually, subformname and subsubformname are NOT the names of the subforms.

They're the names of the subform CONTROLS on the respective forms. Depending
on how you add a form as a subform, the name of the subform control can be
different than the name of the form being used as a subform.
 
Thank you Doug, and indeed I found this concept quite troubling. I think I
am clear on it now, though. I need to be referencing the name of the sub
form control, not the name of the sub form control's source object? It seems
so simple now, but was very confusing to me.

Greg
Actually, subformname and subsubformname are NOT the names of the subforms.

They're the names of the subform CONTROLS on the respective forms. Depending
on how you add a form as a subform, the name of the subform control can be
different than the name of the form being used as a subform.
[quoted text clipped - 26 lines]
 
Back
Top