Results 1 to 8 of 8
  1. #1
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146

    When to make relationships between tables

    What would be the rule of thumb to determine when to make relationships between tables? Subjective at times I guess. Say you have a main table which contains multiple fields that use Lookup tables, when would you want to create relationships to these Lookup tables, if ever?



    Thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I think most people here would advise against using lookups in fields. See: http://access.mvps.org/access/lookupfields.htm
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    I think I miss spoke. I was referring to a main table that has multiple fields which get filled with a form that has a combo box which gets it's data from a separate table. Is there value to then create a relationship between the main table and the separate table that was used in the forms combo box?

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    you don't have to create relationships, but if you do it gives you more control over the data. Up to you whether you want or need that control

    Say you delete one of the records in your lookup table. Now your main table cannot find it so if you still want to see the main table record joined to the lookup table, you will need to use a left join. left joins are slower than inner joins and potentially more work to handle the exception (handling nulls for example). Apply a relationship and enforce referential integrity and you cannot delete the record in the lookup table until none of the main table records reference it.

    Just having a relationship without enforcing integrity doesn't achieve much except it helps you and others to understand what relates to what and of course provides the join when developing queries.

  5. #5
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    Thanks for the info, appreciated

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,127
    Following on from @Ajax's comments, please see my three part article on relationships and referential integrity
    https://www.isladogs.co.uk/relationships1/index.html
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  7. #7
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    Thanks isladogs, enlightening.

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,127
    You're welcome. I wrote the article as I had never found a clear reference as a link for use in forum posts.
    The final page on the MSysRelationships table was additional info for anyone interested. That isn't required information to use relationships effectively!
    Last edited by isladogs; 03-03-2022 at 09:16 AM.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Make Table Query when there are relationships
    By Ian Frost in forum Queries
    Replies: 1
    Last Post: 10-06-2016, 07:24 AM
  2. Many to Many Relationships among 8 tables
    By Pilotwings_64 in forum Database Design
    Replies: 9
    Last Post: 10-30-2010, 03:12 AM
  3. 8 Tables with Relationships
    By bigdogxv in forum Access
    Replies: 1
    Last Post: 12-09-2009, 09:37 PM
  4. Relationships btw tables
    By metaDM in forum Queries
    Replies: 0
    Last Post: 03-05-2009, 12:15 PM
  5. I need help on relationships for tables.
    By justin.w in forum Access
    Replies: 0
    Last Post: 10-16-2006, 10:57 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