Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

How to setup and read data from nested subforms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
magicdds- - 30 Mar 2008 05:39 GMT
I want to set up the following nested subforms:

Main - has a field "OrderID"
   subform1 - has a textbox "Name1" & Field "orderID" & "OrderID1"
       subform2 - has a textbox "Name2" & Field "OrderID1" & "OrderID2"
           subform3 - has a textbox "Name3" & Field "OrderID2"

Subform1 is linked Child & Parent with "OrderID"

To reference "Name1" I do the following:
X = Forms!Main!Subform1.Form!Name1
or
Forms!Main!Subform1.Form!Name1.Visible = true

My Questions are?
1) What do I put in the Link Parent and Link Child property for subform2 and
subform3?

2) How do I write code to reference Name2 (on subform2) and how do I
reference Name3 (on subform3) like I did above to reference Name1 (on
subform1)?

I appreciate any help with this.
Thanks,
Mark
Douglas J. Steele - 30 Mar 2008 12:24 GMT
Assuming I'm interpretting correctly that subform2 is a subform on subform1
and that subform3 is a subform on subform2, you'd refer to controls on them
as

Forms!Main!Subform1.Form!Subform2.Form!Name1

and

Forms!Main!Subform1.Form!Subform2.Form!Subform3.Form!Name1

However, depending on how you added the forms as subforms, be aware that the
name of the subform control can be different than the name of the form being
used as a subform. It's the name of the subform control you need to use, not
the name of the form being used. See
http://www.mvps.org/access/forms/frm0031.htm at "The Access Web" for more on
this topic.

Since Subform2 is a subform on Subform1, what you put in the Link Parent
property must refer to controls on Subform1 and what you put in the Link
Child property refers to controls on Subform2. Similarly, since Subform3 is
a subform on Subform2, what you put in the Link Parent property must refer
to controls on Subform2 and what you put in the Link Child property refers
to controls on Subform3.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I want to set up the following nested subforms:
>
[quoted text clipped - 22 lines]
> Thanks,
> Mark
magicdds - 30 Mar 2008 23:07 GMT
Thanks for your help

> I want to set up the following nested subforms:
>
[quoted text clipped - 21 lines]
> Thanks,
> Mark
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.