Results 1 to 4 of 4
  1. #1
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265

    Why does another instance of the primary key table get created automatically?

    Screen shot attached. I am working with the tables 'tblGymnast' and 'tblAllergies.' Any gymnast may enter up to five different allergies if any at all. I linked the Primary Key, AllergyID in tblAllergies to Allergy1 of tblGymnast. So far no problem. But then I attempted to link AllergyID in tblAllergies to Allergy2 of tblGymnast and automatically a new table, tblAllergies_1 was created.



    Why was this created?

    Wouldn't I have to link AllergyID to Allergy2 of tblGymnast so that a second allergy can be entered? I was going to do Allergy3, but I got this other table created. How can I link all 5 Allergy fields in tblGymnast to the primary key in tblAllergies?
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Because this is linking the same table to multiple fields. Pull in tblAllergies table 5 times.

    What is the second link on Allergy2 field that is outside the image?

    Multiple like fields is not a normalized structure. If you try to filter records for all gymnasts with penicillin allergy, have to search all 5 fields. Also, is 5 fields enough? What about the exception who has 7 allergies? A normalized, related table would allow for any number allergies.
    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
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265
    Quote Originally Posted by June7 View Post
    What is the second link on Allergy2 field that is outside the image?
    I just noticed that. Allergy2 is linked to another table that was automatically created called tblAllergies_2.

    Quote Originally Posted by June7 View Post
    Multiple like fields is not a normalized structure. If you try to filter records for all gymnasts with penicillin allergy, have to search all 5 fields. Also, is 5 fields enough? What about the exception who has 7 allergies? A normalized, related table would allow for any number allergies.
    If a gymnast had 7 allergies, wouldn't they need 7 fields to store 7 allergies?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    7 fields unless you use a related normalized table, like:
    GymnastID AllergyID
    1 2
    1 5
    4 8
    6 3
    6 2
    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. Replies: 5
    Last Post: 10-11-2013, 07:29 AM
  2. Get last ID of primary key automatically generated
    By California2013 in forum Access
    Replies: 1
    Last Post: 09-12-2013, 05:57 AM
  3. Should I use the automatically created ID field?
    By Accessnoobee in forum Access
    Replies: 4
    Last Post: 09-28-2012, 11:16 AM
  4. Replies: 7
    Last Post: 04-17-2012, 11:53 AM
  5. Replies: 2
    Last Post: 07-28-2011, 09:20 PM

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