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 / General 1 / February 2005

Tip: Looking for answers? Try searching our database.

Form/SubForm access problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ego - 24 Feb 2005 09:09 GMT
Hi  all ,

I had created the following  Form/SubForm structure :

MainForm
      SubForm A (SubForm of  MainForm)
         SubForm B (SubForm of SubForm A)
           SubForm C (SubForm of SubForm B)
             SubForm D  (SubForm of SubForm C)

On each form I have a text box.
When The MainForm is open I had managed  to access the text box on
SubForm A
With the following command:

Dim ctrlSubForm As Access.SubForm
Set ctrlSubForm = FrmSubSubjectASubForm
ctrlSubForm(SubSubjectA).Enabled = True
ctrlSubForm(SubSubjectA).SetFocus
B = ctrlSubForm(SubSubjectA).Text

But using the same method to access SubForm B,C, and D I got an error
message.

Please help me.
Thanks.
deko - 24 Feb 2005 15:05 GMT
> I had created the following  Form/SubForm structure :
>
[quoted text clipped - 17 lines]
> But using the same method to access SubForm B,C, and D I got an error
> message.

You can only nest so many subforms.
This shows the limit and syntax for referencing subforms:
Forms("frmMainForm")!frmSubFormA.Form!SubFormB.Form!txtBox

The only exception I've found is if you have a subdatasheet in SubFromB - it
displays okay, but I don't think you can reference it with code.
King Ron - 24 Feb 2005 16:45 GMT
Ola E:

I know A97 was limited to subforms nested 3 deep at the max. I'm not
positive, but have not heard that this limitation has been altered in
any version since.

You can reference controls on an embedded subform or sub-subform much
more easily with dot referencing:

Me.mySfmA.Form.myControlName.Value

and

Me.mySfmA.Form.mySfmB.Form.myControlName.Value

where mySfmA is the name of the subform control on the main form and
mySfmB is the name of the subform control on the Form contained in the
mySfmA control. <= huh? even i'm confuzzed.

King Ron of Chi
ego - 28 Feb 2005 08:34 GMT
ego - 28 Feb 2005 08:30 GMT
Thanks deko,
Have a nice day.
ego - 28 Feb 2005 09:16 GMT
Hi again,

I tried to use both methods.
I got the following Error message on both cases:

" Object doesn't support this property or method (error 438) "

Ego
 
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.