Use Me to refer to a separate subform?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good Evening

I am on a subform of my main form and want to refer to a separate subform of
the main form. Can I use Me:

Me!sfrmHeader.sfrmHeader!cboDestination

or do I have to refer to the main form:

Forms!frmText!sfrmHeader.sfrmHeader!cboDestination

(the subform control has the same name as the subform).

I know I could try it, but I have to change a large number of references and
I want to do it all at once.

Thank you

Peter
 
Peter

"Me" refers to the object in which the code is running, if I recall
correctly. Have you looked at using "Parent"? This might give you a way to
refer back "up" from within a subform, then "back down" into another
subform.

Or you might be able to set variables equal to the various forms/subforms
you'll want to use, and refer to those variables instead...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Peter said:
I am on a subform of my main form and want to refer to a separate subform of
the main form. Can I use Me:

Me!sfrmHeader.sfrmHeader!cboDestination

or do I have to refer to the main form:

Forms!frmText!sfrmHeader.sfrmHeader!cboDestination

(the subform control has the same name as the subform).


Sort of.

Me.Parent.sfrmHeader.Form.cboDestination
 
Back
Top