Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

screen.activeform on a sub

Status
Not open for further replies.

patfee

Programmer
Dec 14, 2004
78
NL
Hi,
how can i derive the name of a subform (nested in a main form) like you can do on the main form by using screen.activeform.

i.e. when i click a button on a subform, the screen.active form returns the name of the main form... while i'm looking for the name of the subform....

Thanks,
Pat
 
How are ya patfee . . . . .

Directly no can do, however the [blue]Parent[/blue] of most controls are the form/subform where they reside, so:
Code:
[blue]Screen.ActiveControl.Parent.Name[/blue]
When using the [blue]Parent[/blue] property be aware of controls in controls. A checkbox in an option group for instance would return the option group instead of the form.

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top