Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple tables in subform

Status
Not open for further replies.

darkmage1

Technical User
Jan 30, 2005
28
US
I have a main form that I display basic information about actors in my dvd collection. My main table has the primary key "ProgramID". My actors table has primary key "ActorID" and my Characters table has primary key "CharacterID".

On my main form there is a subform that displays what movies this actor has been in.I would like to add another field to this subform that displays what character this actor played in each of the movie selections displayed in the subform. Below is the record source for my subform:

SELECT DISTINCTROW Actors.*, main.ProgramID, main.title FROM main RIGHT JOIN (Actors LEFT JOIN ProgramActorJoin ON Actors.ActorID=ProgramActorJoin.ActorID) ON main.ProgramID=ProgramActorJoin.ProgramID;

The above code links my actor and movies together. This code works. I would like to add the character table to this code and link all 3 tables together, so when you display an actors record, the subform shows the movies the actors been in and also the characters. Any help would be greatly appriciated.
 
ChaoticEmpire, I think you're in the wrong forum.

Because, I would create 2 subforms, "Movies" & "Characters"

Each subtable with a foreign key, fkActorID.

I woukld use the subform's
LinkChildFields
LinkMasterFields to link the tables to ActorID in main form.

You should be in the Forms forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top