Results 1 to 3 of 3
  1. #1
    zlloyd1 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    5

    Question Can't create relationships (Driving me nuts!!)


    I am trying to make a simple database in Microsoft Access Professional Plus 2010, but it will not allow me to create a relationship properly because of. "No unique index found for the referenced field of the primary table". It will allow me to create a relationship between the two fields in question, but if I try to enforce referential integrity, it crashes and won't do it.... I have included screenshots of what is happening and would greatly appreciate any advice here, thanks in advance!!
    Attached Thumbnails Attached Thumbnails relation.JPG   wontlink.JPG  

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    To referential integrity between two tables, one table (the primary table) must have unique values. It doesn't have to be the primary key, but the field must have unique values. The other field shouldn't have unique values.

    There are other problems... You have all three tables with the PK as "Case ID". (BYW, You shouldn't use spaces in object names.) This is a one to one to one relationship. (I don't think that is what you want)
    Each table should have different names for the PK fields to avoid confusion. It doesn't make sense to have the table "Tracer Log" have a PK of "Case ID". I would name the PKs:
    Code:
    Table           PK Field name
    ---------------------------------
    Contact      "Contact_ID"
    Tracer Log   "T_Log_ID"
    HUD           "Hud_ID"
    If you wanted to referential integrity between Tables "HUD" and "Contact", with "Contact" being the primary table, you would add a field to the "HUD" table:
    Name: "ContactID_FK"
    Type: Long

    Then drag the "Contact" table "Contact_ID" field to the "ContactID_FK" in the "HUD" table and set the referential integrity check box.

  3. #3
    zlloyd1 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    5

    Thumbs up Thanks a Million... That was the issue and it works now, Your the BEST!!

    Quote Originally Posted by ssanfu View Post
    To referential integrity between two tables, one table (the primary table) must have unique values. It doesn't have to be the primary key, but the field must have unique values. The other field shouldn't have unique values.

    There are other problems... You have all three tables with the PK as "Case ID". (BYW, You shouldn't use spaces in object names.) This is a one to one to one relationship. (I don't think that is what you want)
    Each table should have different names for the PK fields to avoid confusion. It doesn't make sense to have the table "Tracer Log" have a PK of "Case ID". I would name the PKs:
    Code:
    Table           PK Field name
    ---------------------------------
    Contact      "Contact_ID"
    Tracer Log   "T_Log_ID"
    HUD           "Hud_ID"
    If you wanted to referential integrity between Tables "HUD" and "Contact", with "Contact" being the primary table, you would add a field to the "HUD" table:
    Name: "ContactID_FK"
    Type: Long

    Then drag the "Contact" table "Contact_ID" field to the "ContactID_FK" in the "HUD" table and set the referential integrity check box.

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

Similar Threads

  1. How to create multiple table relationships
    By robi212 in forum Access
    Replies: 1
    Last Post: 03-30-2012, 07:59 AM
  2. Create Relationships
    By snowboarder234 in forum Access
    Replies: 4
    Last Post: 03-20-2012, 04:27 PM
  3. Replies: 3
    Last Post: 06-07-2011, 05:05 PM
  4. SELECT Query, Driving Me Nuts!!
    By mystifier in forum Queries
    Replies: 4
    Last Post: 04-21-2011, 04:00 PM
  5. Access 2007 Form Changes Driving Me Nuts
    By Patrick.Grant01 in forum Forms
    Replies: 3
    Last Post: 05-19-2009, 09:17 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