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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the name of a subform 1

Status
Not open for further replies.

zevw

MIS
Jul 3, 2001
697
US
I have a record selected in a subform and I click on delete in the parent form

I know I can do Form![Parentform]![Subform].subform

How can I get the name of the subform with Me.Name

Me.Name gives me the parent form name not the subform name
 
Did you try this ?
Me![subform control].Form.Name

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Or perhaps this:
Screen.PreviousControl.Parent.Name

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks!

Since it was in tab control it was giving me the name of the Tab.

So I used

Code:
FrmName = Screen.PreviousControl.Form.Name
 
How do I now combine the variable with this string

Code:
WrdNum = "Forms!ReviewForm!" & FrmName & ".Form.WordId"
doesn't work its a string
Code:
WrdNum = Forms!ReviewForm![FrmName].Form.WordId
It doesn't recognize FrmName as a variable?
 
I'd try this:
WrdNum = Eval("Forms!ReviewForm!" & FrmName & ".Form!WordId")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top