Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    TDSRU is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    10

    Linking table

    I have a database with the following tables (among others):

    tbl_Projects
    tbl_Staff
    tbl_ProjectsStaff
    tbl_Payroll
    tbl_Training
    tbl_Clients
    tbl_ProjectClients
    tbl_ClientContracts
    tbl_CostEstimates

    As you can see I created two linking tables (project/staff and project/client)



    After that I linked other tables to the liking table. For example, tbl_Payroll and tbl_Training are linked to the tbl_ProjectStaff primary key.

    I don't know much about access so I wanted to check if this is a correct design. I create forms that work well, but I noticed that the linking table doesn't have any data in it. The payroll table and the training table have the staff iDs and Project IDs but the tbl_ProjectStaff is empty. I would appreciate any feedback on the database design.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Based on the names, the design seems correct. The "linking" tables are often referred to as junction tables.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    TDSRU is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    10

    Linking table

    Thank you for your reply.

    What is the function of the junction table if it is empty?

    Thanks

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Nothing. It's function, like any table's, is to hold data. It wouldn't have data until you put it there, via a form, etc. Were you expecting it to populate itself?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    TDSRU is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    10

    Linking table



    I don't plan to enter data on this table, I was just using to create the many-to-many relationship. But maybe I don't need this table. Maybe the payroll and training table would have this function of creating the many-to-many relationship between projects and staff. Can I have several junction tables (e.g. Payroll, training, etc)?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The junction table would hold the data of the many-to-many relationship. For instance if project A had 3 staff members, that table would have 3 records, each with the key for project A and one of the staff keys.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    TDSRU is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    10

    Linking table

    But right now I do that with the payroll table, training table, banked hours table, etc. Can I have more than one junction table for the same junction (staff-project)?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    How would any of those hold the combinations of projects and staff? They each sound like they contain other information. What are their fields?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    TDSRU is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    10

    Linking table

    Payroll for example has task, hour, coat centre, etc +

  10. #10
    TDSRU is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    10

    Linking table

    Sorry for the other message. I sent it by mistake before finishing it.

    Payroll for example has task, hour, cost centre etc + staff_ID, Project_ID, Staff-Project_ID and Payroll_ID.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That's along the lines of what I would expect, but is NOT the project/staff info. Perhaps you don't need or want the table, but it's purpose is what I described in post 6.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You added an ID field from the staff/project table, but if you don't populate it where is that ID coming from?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    TDSRU is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    10

    Linking table

    It is the main ID of the staff/project table, but It is also empty.

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Many-to-many relationship requires junction table. Review http://office.microsoft.com/en-us/ac...aspx?section=9
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    TDSRU is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    10

    Linking table

    Should I have 1 junction table for each set of topics (e.g. Payroll, training, etc) or should I make a huge junction table with everything?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. CALENDAR on FORM not LINKING to TABLE
    By taimysho0 in forum Forms
    Replies: 5
    Last Post: 01-12-2012, 06:55 PM
  2. Linking forms to table
    By jdvd in forum Forms
    Replies: 1
    Last Post: 12-11-2011, 06:20 PM
  3. Fields not Linking to Table
    By jlclark4 in forum Forms
    Replies: 2
    Last Post: 12-20-2010, 08:04 AM
  4. BE / FE new table linking
    By jordanturner in forum Access
    Replies: 3
    Last Post: 10-22-2010, 10:48 AM
  5. Table linking
    By emccalment in forum Access
    Replies: 7
    Last Post: 01-28-2010, 03:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums