Nested Continuous forms

P

Phil

I have a form with 2 nested sub forms, but I can't get it to do what I what.
If the forms are A, B, & C I want C continous in B and then B (along with
continuous C) contiuous in A. What I get is C continous in B and B
continuous and C continuous. Huh???

Saying it another way (because even I don't understand what I wrote) each
item in A can have mulltiple items from B and EACH item in B can have
multiple items from C. What I get is each item in A can have multiple items
from both B and C. ( theat wording is only slightly better. Hope you gurus
can understand what I'm trying to do.

Thanks.
 
A

Albert D. Kallal

You can't nest continues forms inside of continues forms.

However, a nice work around is to have a main form, and then drop two
sub-forms.
side by side. You thus get the same result.

As you navage the "many" in form "b", then form "c" can show the "many" for
each selected record.

There is some screen shots here that will give you an idea
here....

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm

Take close look at the very LAST screen shot...

You have a main record, and then on the left side.."many"
display for that main record. And, on the right side, "many"
records display for each record selected from the left side.


In the link child/master settings for child form "b", you place:

linkChildFields main_id (whatever is the name of the field in
this sub-form that is used to relate back to the parent table)
LinkMasterFields [ID]

In the link child/master settings for child 2 form you place
(form c)

linkChildFields mainB_id (whatever is the name of the field in
this sub-form that is used to relate back to the parent table)
LinkMasterFields [subFormB].[form].[ID] ("Form" is the name of
the contorl you used to hold the form b).
 
P

Phil

Thanks Albert, good approach. Everything looks good, but I'm having trouble
linking the forms. B is linked OK to A. I can link C to A, but I get all Cs
for each A, C is not linked to B. I don't understand where to type your
Masterfields' [ID].

B and C are only linked to each other through A.

BTW, I'm in Edmonton too.

Phil
Newbie
 
A

Albert D. Kallal

Phil said:
Thanks Albert, good approach. Everything looks good, but I'm having
trouble
linking the forms. B is linked OK to A. I can link C to A, but I get all
Cs
for each A, C is not linked to B. I don't understand where to type your
Masterfields' [ID].


You don't want to link c to a...I assume

A - main form
b - many reocrds related to a (main form)
c - many records related to b (show many rrecords for each b)
B and C are only linked to each other through A.

Well, actually, we want to link c to b
I don't understand where to type your
Masterfields' [ID].

How then have you been setting up the linking then? (you have to be typing
those link master/child fields in..else you could not yet linked anything!!!

You just spent the last posting telling me how you been linking those forms,
but the ONLY way for this to work is to set the link master/child fields on
those sub-form controls.

note carefully the settings of the link master/child field (are you able to
find these settings??? -- I mean, how could you speak of linking..but then
not know to use these settings?).

Anyways, remember, a form is simply something that you put text box controls
on, combo box controls on, and also sub-form control. Note I said CONTROL.
A sub-form control is just that...a control on a form that allows you to
display a sub-form. The name of this sub-from control does not have to be
the same name as the sub-form it displays (just like a regular text box
control is USUALLY named the same as the underlying field in the reocdset
for the form...it does not have to be. You can place a text box called
"zoo", and in the data tab set the zoo field to display/edit Company field
from the table.

The exact same concept applies to a sub-form control. You place this
sub-form control on the screen, give it a name. You can THEN SET what
sub-form will display, and also in the properties for this sub=form control
is where you set the link master/child fields.

So, those settings I showed should work (but, you have to use the name of
your controls you placed on the main form (again, they may, or many not
actually be the same name as the actual sub forms used).

Also, while navigation on our main form "a" will case sub-form b to display
the correct child records, You have to place one line of code in the forms
"b" code to refresh the sub-form "c" records.

so, in the on-current event of the sub-form b, you have to go:

Me.Parent.frmC.Form.Requery

So, to get at the link master/child field settings, you simply bring up form
"a" in design mode. Make sure the properties sheet is displaying. the click
ONCE on a sub-form (do not click twice....as then you will have selected the
sub-form..and you want the sub-form control...).

So, click once on the sub-form control...and you see the properties sheet.
In that sheet you can change what sub-form is display, and the link
master/child field settings are available. So, I don't know how you been
linking those sub-forms, but without setting the link master/child in the
properites sheet, you could not have been linking those sub-forms correclty.

I would concentra on making the the form b work to display the reocrds for
form a. Once that works, then you can setup the link fields for the contorl
that displays form c...
 
P

Phil

Thanks, I have been using the Properties Sheet, but also the little pop-up
window you get when you click the three dots. I will review what you sent
and try tomorow night.

Thanks.

Phil
Newbie

Albert D. Kallal said:
Phil said:
Thanks Albert, good approach. Everything looks good, but I'm having
trouble
linking the forms. B is linked OK to A. I can link C to A, but I get all
Cs
for each A, C is not linked to B. I don't understand where to type your
Masterfields' [ID].


You don't want to link c to a...I assume

A - main form
b - many reocrds related to a (main form)
c - many records related to b (show many rrecords for each b)
B and C are only linked to each other through A.

Well, actually, we want to link c to b
I don't understand where to type your
Masterfields' [ID].

How then have you been setting up the linking then? (you have to be typing
those link master/child fields in..else you could not yet linked anything!!!

You just spent the last posting telling me how you been linking those forms,
but the ONLY way for this to work is to set the link master/child fields on
those sub-form controls.

note carefully the settings of the link master/child field (are you able to
find these settings??? -- I mean, how could you speak of linking..but then
not know to use these settings?).

Anyways, remember, a form is simply something that you put text box controls
on, combo box controls on, and also sub-form control. Note I said CONTROL.
A sub-form control is just that...a control on a form that allows you to
display a sub-form. The name of this sub-from control does not have to be
the same name as the sub-form it displays (just like a regular text box
control is USUALLY named the same as the underlying field in the reocdset
for the form...it does not have to be. You can place a text box called
"zoo", and in the data tab set the zoo field to display/edit Company field
from the table.

The exact same concept applies to a sub-form control. You place this
sub-form control on the screen, give it a name. You can THEN SET what
sub-form will display, and also in the properties for this sub=form control
is where you set the link master/child fields.

So, those settings I showed should work (but, you have to use the name of
your controls you placed on the main form (again, they may, or many not
actually be the same name as the actual sub forms used).

Also, while navigation on our main form "a" will case sub-form b to display
the correct child records, You have to place one line of code in the forms
"b" code to refresh the sub-form "c" records.

so, in the on-current event of the sub-form b, you have to go:

Me.Parent.frmC.Form.Requery

So, to get at the link master/child field settings, you simply bring up form
"a" in design mode. Make sure the properties sheet is displaying. the click
ONCE on a sub-form (do not click twice....as then you will have selected the
sub-form..and you want the sub-form control...).

So, click once on the sub-form control...and you see the properties sheet.
In that sheet you can change what sub-form is display, and the link
master/child field settings are available. So, I don't know how you been
linking those sub-forms, but without setting the link master/child in the
properites sheet, you could not have been linking those sub-forms correclty.

I would concentra on making the the form b work to display the reocrds for
form a. Once that works, then you can setup the link fields for the contorl
that displays form c...
 
Top