Different many to many relationships that all contain the same table

Sing songs 0 Reputation points
2026-11-24T13:25:25.7766667+00:00

I'm making a database that will contain a library of sheet music.

Every Title (tblTitel) can have several composers (tblComposer), lyricists (tblLyricist), and arrangers (tblArranger)

and all the composers, lyricists, and arrangers can be responsible for many titles.

So, I need to make seperate junction tables for all of the many to many relationships described above, right?

Or is there a better solution?

Also, do I use fields from the junction tables to display all the titles of a, let's say composer, in a form or a query, or do I use fields from the parent table?

I can NOT get this to work, and I've tried so many ways I no longer know left from right or up from down.

I am confusion.

Please help me think, or I'll be stuck here forever.

I fear.

Microsoft 365 and Office | Access | Other | Other
0 comments No comments

4 answers

Sort by: Newest
  1. Ken Sheridan 3,581 Reputation points
    2026-11-24T21:38:31.9066667+00:00

    The image below is the model for a database of company personnel, which is analogous to what you are attempting, in that a person might be an officer, director or shareholder of a company:

    CompanyPersonnelModel

    The user interface is a companies form, analogous to a titles form in your case, in which are embedded three categorised subforms:

    CompaniesForm

    The above is taken form my FindRecord demo, which you'll find in my public DropBox folder at:

    https://www.dropbox.com/scl/fo/0scigd3r48hx5xrev2jrf/AB0-GMdTgMAO5O1cGdr3QW0?rlkey=ib6bs6g9jqcrywwzivur3265t&dl=0

    Was this answer helpful?


  2. Marcin Policht 113.9K Reputation points MVP Volunteer Moderator
    2026-11-24T13:50:55.0966667+00:00

    Yep - you need three separate junction tables because you have three independent many-to-many relationships: titles and composers, titles and lyricists, and titles and arrangers. This is the correct relational database design for your situation. There is no need to combine these relationships into a single junction table.

    Try tables that are structured as follows:

    • tblTitle: TitleID (PK), Title
    • tblComposer: ComposerID (PK), ComposerName
    • tblLyricist: LyricistID (PK), LyricistName
    • tblArranger: ArrangerID (PK), ArrangerName
    • tblTitleComposer: TitleID (FK), ComposerID (FK)
    • tblTitleLyricist: TitleID (FK), LyricistID (FK)
    • tblTitleArranger: TitleID (FK), ArrangerID (FK)

    In each junction table, make the combination of the two foreign keys a composite primary key. This prevents duplicate associations between a title and a person.

    In the Access Relationships window, establish one-to-many relationships between each parent table and its corresponding junction table. For example, tblComposer.ComposerID connects to tblTitleComposer.ComposerID, and tblTitle.TitleID connects to tblTitleComposer.TitleID. Enable referential integrity for each relationship.

    Now, to address your second question, this is where the distinction becomes important: you use the junction table to establish the relationship, but you use fields from the parent tables to display the actual information.

    For example, suppose you want to display all titles associated with a particular composer. Create a query containing tblComposer, tblTitleComposer, and tblTitle. Join them using their respective IDs. Include ComposerName from tblComposer and Title from tblTitle in the query output. The junction table supplies the connection between them.

    For your forms, consider using a main form and a subform. For example, create frmComposer based on tblComposer and sfrmComposerTitles based on a query joining tblTitleComposer and tblTitle. Set the subform's Link Master Fields to ComposerID and Link Child Fields to ComposerID. When you navigate between composers, the subform will automatically display their associated titles.

    Apply the same approach to lyricists and arrangers.

    Note that you do not need to display the junction table itself to the user. Think of it as the mechanism that connects the records. Your queries and forms can present the information from the parent tables in a much more natural way.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?


  3. George Hepworth 23,135 Reputation points Volunteer Moderator
    2026-11-24T13:49:25.1133333+00:00

    The AI answer appears to be appropriate. Use a "Contributor" table with an additional field to designate the different roles. The fields in the Junction table will all be foreign keys. Any details, such as a title, are stored in the table with the person's other details. I assume here that "title" is different from "role" in your design.

    I have a similar design, in fact, in a database for movies, in which one person can both direct and act in a movie.

    Was this answer helpful?

    0 comments No comments

  4. AI answer

    2026-11-24T13:26:25.85+00:00

    Use one tblContributor table for people and one tblTitleContributor junction table containing the contributor’s role, rather than separate Composer, Lyricist, and Arranger tables.

    Composer, lyricist, and arranger are roles, not different kinds of people. The same person could compose one title, arrange another, or hold multiple roles on the same title. Storing that person once avoids duplicate names and inconsistent details, consistent with Access normalization guidance.^1^

    Create these tables:

    tblTitle

    Field Type Notes
    TitleID AutoNumber Primary key
    TitleName Short Text
    other title fields appropriate types

    tblContributor

    Field Type Notes
    ContributorID AutoNumber Primary key
    GivenName Short Text
    FamilyName Short Text

    tblRole

    Field Type Example values
    RoleID AutoNumber Primary key
    RoleName Short Text Composer, Lyricist, Arranger

    tblTitleContributor

    Field Type Notes
    TitleContributorID AutoNumber Primary key
    TitleID Number, Long Integer Foreign key
    ContributorID Number, Long Integer Foreign key
    RoleID Number, Long Integer Foreign key

    Each record in tblTitleContributor represents one fact, such as:

    TitleID ContributorID RoleID
    10 4 Composer
    10 7 Lyricist
    10 4 Arranger

    A many-to-many relationship is implemented by a junction table that turns it into two one-to-many relationships.^2^

    If a credit has additional information—such as credit order, pseudonym, or notes—put those fields in tblTitleContributor, because they describe that particular title/person/role association.

    Also create a unique multi-field index over:

    • TitleID
    • ContributorID
    • RoleID

    That prevents the same person from accidentally receiving the same role twice for one title.

    Create the relationships

    In Database Tools > Relationships:

    1. Relate tblTitle.TitleID to tblTitleContributor.TitleID.
    2. Relate tblContributor.ContributorID to tblTitleContributor.ContributorID.
    3. Relate tblRole.RoleID to tblTitleContributor.RoleID.
    4. Select Enforce Referential Integrity for each relationship.
    5. Make sure every junction foreign key is Number / Long Integer, because it references an AutoNumber primary key.

    The resulting relationships are:

    tblTitle       1 ─── ∞ tblTitleContributor ∞ ─── 1 tblContributor
                                  ∞
                                  │
                                  1
                               tblRole
    

    Referential integrity prevents junction records from referring to nonexistent titles, contributors, or roles.^2^

    Query all titles for a composer

    Use the junction table to connect and filter records, but normally display fields such as the title name from tblTitle and the person’s name from tblContributor.

    In Create > Query Design, add all four tables. Access should add the joins automatically if the relationships are defined. A query needs the junction table even when its ID fields are not displayed.^3^

    Equivalent Access SQL:

    SELECT C.ContributorID,
           C.GivenName,
           C.FamilyName,
           T.TitleID,
           T.TitleName
    FROM ((tblContributor AS C
    INNER JOIN tblTitleContributor AS TC
        ON C.ContributorID = TC.ContributorID)
    INNER JOIN tblTitle AS T
        ON TC.TitleID = T.TitleID)
    INNER JOIN tblRole AS R
        ON TC.RoleID = R.RoleID
    WHERE R.RoleName = "Composer"
    ORDER BY C.FamilyName, C.GivenName, T.TitleName;
    

    Access uses JOIN clauses to retrieve related information from multiple tables; the key fields can be used for matching without being shown to users.^4^

    To show titles for only one particular contributor, add this criterion under ContributorID:

    Forms![frmContributor]![ContributorID]
    

    Display the titles on a form

    A main form/subform design is the simplest arrangement:

    1. Create frmContributor, based on tblContributor.
    2. Save the composer query as qryContributorTitles.
    3. Create a continuous or datasheet form named sfrmContributorTitles, based on that query.
    4. Include ContributorID in the subform’s record source, but hide its control if desired.
    5. Open frmContributor in Design View and add a Subform/Subreport control.
    6. Set:
      • Source Object: Form.sfrmContributorTitles
      • Link Master Fields: ContributorID
      • Link Child Fields: ContributorID

    The subform will then show only titles associated with the contributor currently displayed on the main form. Access subforms are designed for this one-to-many parent/child display.^5^

    For entering credits, use a subform bound to tblTitleContributor and combo boxes for ContributorID and RoleID. Store the numeric IDs while displaying contributor and role names.

    Separate contributor tables and three junction tables can technically work, but they duplicate the same kind of entity and make it awkward when one person has multiple roles. Use that design only if composers, lyricists, and arrangers truly require fundamentally different data and can never overlap.


    References

    1. Database design basics | Microsoft Support
    2. Guide to table relationships | Microsoft Support
    3. Create a query based on multiple tables | Microsoft Support
    4. Perform joins using Access SQL
    5. Create a form that contains a subform (a one-to-many form) | Microsoft Support
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.