subform's control name

  • Thread starter Thread starter DZ
  • Start date Start date
D

DZ

I am a subform on a form. Is their a property or combination of properties I
can use to obtain my control name on the main form programmatically . I am
opening a form and I want to pass my control name as an OpenArg.

Sorry about the figurative explanation. I thought it might make it clearer

Here my code

DoCmd.OpenForm "ZoomBoxForSubForm", , , , , , ????Me.Form????

'.........................................................................Right here ^^^

I tried several different properties. I just csn't get it !

Thanks
 
This may clarify what I want.

I am able to get the subform's name by using ActiveControl.Parent.Name, but
that's not what I need. I want to get the subform's control name on the main
form
 
DZ,
Me.[CtlSubformName].Form.[CtlName] will give you the name of the control on
the subform.

DoCmd.OpenForm "ZoomBoxForSubForm", , , , , ,
Me.[CtlSubformName].Form.[CtlName]

Note that the subform is inside a subform control in much the same way that
a picture is inside an image control.
The name of the subform control is often not the same as the name of the
subform.

Jeanette Cunningham
 
DZ said:
I am a subform on a form. Is their a property or combination of properties I
can use to obtain my control name on the main form programmatically . I am
opening a form and I want to pass my control name as an OpenArg.

Sorry about the figurative explanation. I thought it might make it clearer

Here my code

DoCmd.OpenForm "ZoomBoxForSubForm", , , , , , ????Me.Form????


You can get the name of the main form using:
Me.Parent.Name

You can get the name of your subform's container control
using:
Me.Parent.ActiveControl.Name
 
Back
Top