subform's control name

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
 
D

DZ

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
 
J

Jeanette Cunningham

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
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top