473,387 Members | 1,578 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,387 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 3635
> 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 user to complete before leaving the form or moving...
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 report. The forms worked fine a few weeks ago,...
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 ID. The parent form (frmMainForm) displays the...
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 subform is bound to. The requery is done when 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 details), we got an order with nothing ordered. How can...
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 form. Everything works fine, except for the "Filter...
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 recognize wide screens, and sizes tab controls so that...
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 control acts as a container for the form that you...
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 initially cracked up to be. In the back of my...
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 view the 1:M records. On the parent form, there is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.