Subform linking problem

  • Thread starter Thread starter David
  • Start date Start date
D

David

I have three tables, lets call them A, B and C. A to B is
one-to-many and B to C is one-to-many.

I have a tabbed form (representing a selected table A
record) which allows updates to A and B. The update to B
is done via a scrolling subform.

Now I want to create a subform on a new tab for viewing of
table C records relating to the table A record. There is
no direct relation, they are related via table B.

I want this subform to show all table C records related to
the current table A record. This will be for viewing only.

The new subform will need information from table B and
table C to display on the form. So I guess I have to base
it on a query? How do I code this query to go against the
correct table A record. How do I code the master and child
field links.
 
Table A, key = APK
Table B, key = BPK, foreign key = APK
Table C, key = CPK, foreign key = BPK

Base second subform on

SELECT B.APK, C.CPK FROM B RIGHT JOIN C ON B.BPK = C.BPK

Pavel
 
Thanks, I pretty much already know what you said but what
do I put in the child and master links for the subform?
That is what is stumping me.
 
I apologize for such a long delay answering - getting ready for an
overseas trip...
I think you certainly want to use APK for that - main form base on A, sf
based on the query.
But you must have it solved by now, anyway.

Good luck,
Pavel
 
Back
Top