472,330 Members | 1,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Form/SubForm access problem

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

Nov 13 '05 #1
5 3555
> 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.


You can only nest so many subforms.
This shows the limit and syntax for referencing subforms:
Forms("frmMainForm")!frmSubFormA.Form!SubFormB.For m!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.
Nov 13 '05 #2
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

Nov 13 '05 #3
ego
Thanks deko,
Have a nice day.

Nov 13 '05 #4
ego
Thanks King

Nov 13 '05 #5
ego
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

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a form with multiple pages on it. There is one text field on the third page of the form that I need the...
1
by: J | last post by:
Hi, Ive got 3 forms, (a subform within a subform within a form) and when I refresh the outermost form, Access closes and offers to send an error...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order...
2
by: Lenin Torres | last post by:
Hi everybody I have an Union Query that works fine. I used this query as the RecordSource for a Form. That Form is used as a subform in another...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to...
6
NeoPa
by: NeoPa | last post by:
Introduction The first thing to understand about Sub-Forms is that, to add a form onto another form takes a special Subform control. This Subform...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was...
1
by: troy_lee | last post by:
I have a table (Table A). It has one field, a PK. It is in a 1:M with another table (Table B). I am having trouble with a form/subform setup to...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.