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