By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

How can I find the Parent of a Parent Form?

P: 3
I have three forms we'll call, "Mainform A", "Mainform B" and "Mainform C" in which there is a subform, "Subform" and inside my subform I have another subform, "Sub-Subform". It is paramount to my project to verify the parent of "Subform" and find out whether it's Mainform A, B or C.

I know all about Me.Parent.Name but that doesn't work because the parent of Sub-Subform is always Subform. I tried all manner of things some of which were Forms!Subform.Form.Parent.Name, Forms!Subform.Parent.Name, Subform.Parent.Name etc.

Those all resulted in an error that it couldn't find form Subform, which is rediculous because I didn't even type the name; I did rename, and copied it out of there and then didn't rename my object, then pasted the name into the script.

I also tried making a text box called txtName on Subform that is populated with Me.Parent.Name but then couldn't get a text box in Sub-Subform, txtName1, to pull the text in from txtName.

I'm running out of ideas... Please help!!!
Oct 19 '06 #1
Share this Question
Share on Google+
4 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Try:

Me.Parent.Parent.Name
[size=2][/size]
[size=2][/size]
I have three forms we'll call, "Mainform A", "Mainform B" and "Mainform C" in which there is a subform, "Subform" and inside my subform I have another subform, "Sub-Subform". It is paramount to my project to verify the parent of "Subform" and find out whether it's Mainform A, B or C.

I know all about Me.Parent.Name but that doesn't work because the parent of Sub-Subform is always Subform. I tried all manner of things some of which were Forms!Subform.Form.Parent.Name, Forms!Subform.Parent.Name, Subform.Parent.Name etc.

Those all resulted in an error that it couldn't find form Subform, which is rediculous because I didn't even type the name; I did rename, and copied it out of there and then didn't rename my object, then pasted the name into the script.

I also tried making a text box called txtName on Subform that is populated with Me.Parent.Name but then couldn't get a text box in Sub-Subform, txtName1, to pull the text in from txtName.

I'm running out of ideas... Please help!!!
Oct 20 '06 #2

P: 3
I tried that and I get an error message that it is a misuse of the parent property of the form.
Oct 24 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Suggest you try

Me.Parent.Parent!Name
Me!Parent.Parent.Name
Me!Parent.Parent!Name

Do any of these work?
Oct 25 '06 #4

P: 3
Nope... No luck on that. More error messages.
Nov 15 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.