side-by-side Child & Grandchild lists

W

WDSnews

At this point I'm feeling pretty comfortable with sub-forms and
sub-sub-forms. But in this case, I want a parent form with side-by-side
lists. The left list could be an ordinary sub-form or child table. The
right list should be the grandchild table. In other words, as I navigate up
and down the child items on the left, how can I see the child of the child
items on the right?

For a library, I have a 'Titles' form. For any [Title].[ID], we have
several books, each with its own barcode [book].[barcode]. I'd like to see
the Title on the Parent form, each book in a child list on the left, and
each book's transactions on the right, [Transactions].[Transaction Type],
[Transactions].[People ID].

How do I make the grandchild action happen?

Parent = Title table
Child = Book table
Grandchild = Transactions table
 
W

WDSnews

Very nice explanation. I'll give it a try.

Thank you for your help.


KenSheridan via AccessMonster.com said:
These are known as 'correlated subforms' and are set up as follows:

Add a hidden text box, txtBarcode say, to the parent Titles form. Set its
ControlSource property to reference the primary key barcode column of the
books subform. A control on a subform is referenced via the Form property
of
the subform control, i.e. of the control in the parent form's Controls
collection which houses the subform, so the ControlSource property of the
hidden text box would be something like:

=sfcBooks.Form.barcode

where sfcBooks is the name of the books subform control.

Set the LinkMasterFields property of the transactions subform control to
the
name of the hidden text box:

txtBarcode

and its LinkChildFields property to the name of the field in the
transactions
subform's underlying recordset which references the primary key of the
books
subforms underlying recordset. The primary and foreign keys would
normally
have the same name, in which case the LinkChildFields property would be:

barcode

As you navigate through the rows in the books subform the value of the
hidden
text box in the parent form will change to that of the current barcode, so
the transactions subform will show the transactions for the currently
selected book by virtue of referencing the hidden control as its
LinkMasterFields property.

Ken Sheridan
Stafford, England
At this point I'm feeling pretty comfortable with sub-forms and
sub-sub-forms. But in this case, I want a parent form with side-by-side
lists. The left list could be an ordinary sub-form or child table. The
right list should be the grandchild table. In other words, as I navigate
up
and down the child items on the left, how can I see the child of the child
items on the right?

For a library, I have a 'Titles' form. For any [Title].[ID], we have
several books, each with its own barcode [book].[barcode]. I'd like to
see
the Title on the Parent form, each book in a child list on the left, and
each book's transactions on the right, [Transactions].[Transaction Type],
[Transactions].[People ID].

How do I make the grandchild action happen?

Parent = Title table
Child = Book table
Grandchild = Transactions table
 
W

WDSnews

I tried it and it works great. Thank you.


WDSnews said:
Very nice explanation. I'll give it a try.

Thank you for your help.


KenSheridan via AccessMonster.com said:
These are known as 'correlated subforms' and are set up as follows:

Add a hidden text box, txtBarcode say, to the parent Titles form. Set
its
ControlSource property to reference the primary key barcode column of the
books subform. A control on a subform is referenced via the Form
property of
the subform control, i.e. of the control in the parent form's Controls
collection which houses the subform, so the ControlSource property of the
hidden text box would be something like:

=sfcBooks.Form.barcode

where sfcBooks is the name of the books subform control.

Set the LinkMasterFields property of the transactions subform control to
the
name of the hidden text box:

txtBarcode

and its LinkChildFields property to the name of the field in the
transactions
subform's underlying recordset which references the primary key of the
books
subforms underlying recordset. The primary and foreign keys would
normally
have the same name, in which case the LinkChildFields property would be:

barcode

As you navigate through the rows in the books subform the value of the
hidden
text box in the parent form will change to that of the current barcode,
so
the transactions subform will show the transactions for the currently
selected book by virtue of referencing the hidden control as its
LinkMasterFields property.

Ken Sheridan
Stafford, England
At this point I'm feeling pretty comfortable with sub-forms and
sub-sub-forms. But in this case, I want a parent form with side-by-side
lists. The left list could be an ordinary sub-form or child table. The
right list should be the grandchild table. In other words, as I navigate
up
and down the child items on the left, how can I see the child of the
child
items on the right?

For a library, I have a 'Titles' form. For any [Title].[ID], we have
several books, each with its own barcode [book].[barcode]. I'd like to
see
the Title on the Parent form, each book in a child list on the left, and
each book's transactions on the right, [Transactions].[Transaction Type],
[Transactions].[People ID].

How do I make the grandchild action happen?

Parent = Title table
Child = Book table
Grandchild = Transactions table
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top