473,411 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How can I find the Parent of a Parent Form?

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
4 4819
MMcCarthy
14,534 Expert Mod 8TB
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
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
14,534 Expert Mod 8TB
Suggest you try

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

Do any of these work?
Oct 25 '06 #4
Nope... No luck on that. More error messages.
Nov 15 '06 #5

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

Similar topics

8
by: Yasutaka Ito | last post by:
Hi, Is there a way to find to which control the current control is docked against? For example, let's say I have panel1 and panel2 docked to left within a form. The panel1 is the first one on...
2
by: dinoo | last post by:
Some one help me out. I have a windows form.I added Panel to a windows form. I put a textbox in a Panel. When ever I try to get Parent of textbox. its always returns me the handle of Form not...
25
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I...
4
by: Kaur | last post by:
I am reposting this message. I am a beginner using MS Access. I am working in MS Access 2000 and have created two forms. Form 1 is called frmParent (which has a read only subform called SfrmChild)....
0
by: kloplop321 | last post by:
I found this code(vb only) and it does about the same thing(in vb, not vb .NET 2005) Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
2
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
1
by: amiparna | last post by:
There is two frame in my form.In d first frame there is a text box,and i give some word in the text box.I want to search the word from a file from the location(http://45.12.09.31...........) and if...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.