Results 1 to 11 of 11
  1. #1
    GabrielloG is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    5

    Link one table to 2 already joined tables

    I have 1 table named city linked to another table named location. (1-many relationship). My contacts table has data that needs to be shared on both the city and the location table. How do I do that?

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    In a query, you can join many tables (you are not just limited to 2). They key is identifying how all the tables are linked and setting up the joins accordingly.
    If you need with that, please list the key fields in each table and explain how they are related.

  3. #3
    GabrielloG is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    5
    My tblCity linkes to tblLocation (one to many). And the tblContacts are linked to both tables. This is how the table should be connected.

    Table tblCity
    LookupLocation
    LookupContact (Regional Manager)
    LooKupContact (HR)


    Table tblLocation
    LookupContact (StoreManager)
    LookupContact (StoreClerk)

    Table tblContacts

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    What are the key fields in your tblContacts table?
    Also, can you post the SQL code for the query you currently already have.

    I am not sure, but we might actually need to see some data samples. Note that you can upload your database to this website.

  5. #5
    GabrielloG is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    5
    Database--Web.accdb

    I attached the simplified version

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    OK. I can take a look at it tonight when I get home (I cannot download files from my current location).

  7. #7
    GabrielloG is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    5
    Thanks, Joe

  8. #8
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I am kind of confused by the need for the City table. Is there really a need for a separate table for that?
    Or are you wanting to limit it to certain cities, or really have more information than that on the City table?

    In looking at your table structure, I am also not 100% clear on exactly what it is you are trying to do).

  9. #9
    GabrielloG is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    5
    The city table can be added as a field in the Facility table. But what I am trying to do is connect the 3 tables

    • Facilities
    • Sites
    • Contacts


    The tblsite is a child of the tblfacility and the tblcontacts should link to both tables, sometimes multiple times. i.e. the same contact could be the site manager and the security representative or HR Rep.

  10. #10
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Are you familiar with how to use the Query Builder in Access to add tables/queries together and join them?
    In Access, you can add the same table multiple times. It will give each succeeding copy an "alias". You can then build your joins like you would between any table/query objects.

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Just as the Relationships window shows 3 copies of tblContacts, the query needs to do the same. However, when bringing all three tables into the query builder I see that only one tblContacts is presented and is joined to all three fields in tblSites. Delete two of the links and add tblContacts 2 more times. Manually create the other 2 links.
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Counter in a query with joined tables
    By plus_stick in forum Queries
    Replies: 1
    Last Post: 10-30-2014, 06:36 AM
  2. Replies: 8
    Last Post: 06-04-2014, 10:01 AM
  3. Duplicate records in joined tables
    By msmithtlh in forum Programming
    Replies: 2
    Last Post: 04-10-2013, 08:19 AM
  4. Multiple Tables Joined ????
    By Ekim in forum Database Design
    Replies: 10
    Last Post: 01-15-2012, 07:08 PM
  5. Replies: 0
    Last Post: 06-15-2011, 07:02 AM

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