Results 1 to 7 of 7
  1. #1
    Dave Lambert is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    26

    Table relationship question

    I'm using Access 2016 (Office 365).


    My database has 3 tables: Producer, States, and Insureds.
    I need a 1-to-many relationship from the States table to the Producer table.
    I need a 1-to-many relationship from the States table to the Insureds tables.
    I need 1-to-many relationship from the Producer table to the Insureds table.

    I have a 1-to-many relationship from the States table to the Insureds table. This is on the State Abbr field of the States table and the State field in the Insureds table.

    I also have a 1-to-many relationship from the Producers table to the Insureds table. This is on the Producer field in each table.

    When I try to create a 1-to-many relationship from the States table to the Producer table I can’t get it done. Access keeps trying to create a 1-to-1 relationship. Why?

    Each file has an autonumber primary key.

    I don’t want to put Key values of the states into the Producers and Insureds tables; I want the actual data (State Abbr and the Producer) to be in the tables.

    The fields I’m trying to put the relationships on are not the primary key fields.

    I do not have a lookup table defined. Do I need a lookup table?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    A relationship must include primary key. If you want to save the text values then don't set autonumber as primary key. The text field is the key.
    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.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Dave,

    Your relationships are determined by the business rules/facts of the "business".
    So saying
    I don’t want to put Key values of the states into the Producers and Insureds tables; I want the actual data (State Abbr and the Producer) to be in the tables.
    is a little like cart before the horse situation in my view.

    Can you describe to readers in 4 -5 lines of simple, plain English what Producers, Insureds and States mean in your business?
    Best to use simple terms, no jargon, so we understand what you are dealing with.

    Here is a link to various info on Database Planning and Design. You should research Normalization to help understand table design.

    Good luck with your project.
    Last edited by orange; 08-28-2018 at 06:03 PM. Reason: spelling; more info

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by Dave Lambert View Post
    I do not have a lookup table defined. Do I need a lookup table?
    Nope. My rule is "NEVER use look up FIELDS in Tables!"

    ----------------------------------------------------------------------------------------------------------------

    Quote Originally Posted by Dave Lambert View Post
    I don’t want to put Key values of the states into the Producers and Insureds tables; I want the actual data (State Abbr and the Producer) to be in the tables.
    I can understand about the State abbr because the states are very stable name wise.
    But I would recommend using the PK/FK (number) fields.
    Why do you want to store the agent's name (Producers)?

    If I understood the requirements correctly, the design might look something like this
    Click image for larger version. 

Name:	Relationship4.png 
Views:	24 
Size:	39.4 KB 
ID:	35279


    ----------------------------------------------------------------------------------------------------------------

    I would design the tables/relationships more like this (normalized design):
    Click image for larger version. 

Name:	Relationship4.png 
Views:	22 
Size:	35.4 KB 
ID:	35280

  5. #5
    Dave Lambert is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    26
    Hi al!

    Thanks for the replies! They are greatly appreciated.

    I'm in the logistics department of an agricultural products company. I'm trying to set up a small database where I can keep track of when insurance coverage is due to expire for the policyholders (Insureds) that haul shipments for us. If coverage expires the policyholder(s) cannot haul freight for the company. I'm wanting to create queries/reports that show freight haulers with insurance coverage that will be expiring in the near future (maybe 1 to 2 weeks). This should help us to better keep track of these situations.

    I'm using 3 tables:
    Producers (Insurance Agents, Agencies or Companies)
    Insureds (Policyholders that purchase insurance from the Producers)
    States (The state abbreviations and full names)

    A producer can have many insureds. (one-to-many).
    A state can have many producers (one-to-many).
    A state can be in many insureds addresses (one-to-many).
    An insured/policyholder can have multiple insurance policies through multiple producers in which specific coverages expire at different times.
    Each producer and insured have an address which includes the state. The state is the one side to a one-to-many relationship. The producers and insureds are the many side of that one-to-many relationship.

    I've received some good advice already and am going to read up on those articles and do a bit of redesign.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    This seems to suggest a Many to Many relationship
    An insured/policyholder can have multiple insurance policies through multiple producers in which specific coverages expire at different times.
    Can you mock up a few records (dummy data) for sample test data?
    How much info(multiple insurance policies ) re Policy do you maintain/need?
    Attached Thumbnails Attached Thumbnails ProducersInsuredsDraft0.png  
    Last edited by orange; 08-29-2018 at 10:51 AM.

  7. #7
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by Dave Lambert View Post
    A producer can have many insureds. (one-to-many).
    A state can have many producers (one-to-many).
    A state can be in many insureds addresses (one-to-many).
    An insured/policyholder can have multiple insurance policies through multiple producers in which specific coverages expire at different times.
    Each producer and insured have an address which includes the state.
    Well, that makes a difference.
    I would agree with orange - would need a junction table (for the Many to Many relationship).

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

Similar Threads

  1. Another Table/Relationship Question
    By Squeally in forum Access
    Replies: 7
    Last Post: 07-30-2014, 01:52 PM
  2. Table relationship question
    By Lothar in forum Database Design
    Replies: 4
    Last Post: 06-16-2014, 03:58 PM
  3. Table Relationship Question
    By ccchan in forum Access
    Replies: 5
    Last Post: 03-12-2014, 07:52 PM
  4. Table relationship question
    By scoughlan in forum Database Design
    Replies: 2
    Last Post: 01-05-2012, 04:39 PM
  5. Table Relationship Question!
    By mbake085 in forum Access
    Replies: 5
    Last Post: 08-05-2010, 09:50 AM

Tags for this Thread

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