Results 1 to 6 of 6
  1. #1
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112

    Best way to capture many-to-many relationship

    Hi,
    I have been tasked to do some modifications to a database in my school that was coded by someone else who's no longer with us. I have no previous experience with Access and have only started picking it up and need help.

    It's a student database that captures information of students and their parents (name, date of birth, address, contact number, that kind of thing). The problem with the existing setup is that it uses a 1 (student) to Many (parents) relationship.

    Say, student Jack has a mum and dad. His mum is Jill and his dad is John. So the previous person used a 1(Jack)-to-many(John and Jill) relationship. The problem with this is that Jack can have a sister Sally, so Sally's parents are also John and Jill. This gets very messy for parents with many children all attending our school.

    This creates a minor problem as it introduces duplicates in the parent's information table. I'd like to eliminate this by making it a many-to-many relationship. One student can have many parents, and each parent can have many children.

    My problem comes when capturing this information. We have an existing Access Form which the previous staff created, for new students and their parents to key in their information.



    This won't be a problem for a parent registering for the first time. But how am I going to capture a parent who's registering her second or third child, and I don't want their records to be duplicated in the Parent's table?

    The only thing I can think of is selecting their names from a drop-down box which lists existing parents. But how do I make it generic, so that new parents can also key in their information?

    Thank you!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe you will find this link helpful: http://www.fontstuff.com/access/acctut20.htm

  3. #3
    Dinzdale40 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    12
    instead of a parent table where a kid can have two parents that are two records, you could make it a "guardian" table with records consisting of multiple contacts. Each guardian entry would have a primary key that would be listed for each kid making it so that you could still use a one to many relationship. This may be a better way to relate parents and situations that are unique. Some parents could be divorced representing two guardian records where as some kids could have guardians that aren't their parents at all.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    This link may also provide some thoughts: http://allenbrowne.com/AppHuman.html

  5. #5
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112
    Thanks for the links, RuralGuy. That's the kind of thing I was looking for. I'll give it a try and come back if I encounter any problems. Thanks!

  6. #6
    Buakaw is offline Absolute novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    112
    Quote Originally Posted by Dinzdale40 View Post
    instead of a parent table where a kid can have two parents that are two records, you could make it a "guardian" table with records consisting of multiple contacts. Each guardian entry would have a primary key that would be listed for each kid making it so that you could still use a one to many relationship. This may be a better way to relate parents and situations that are unique. Some parents could be divorced representing two guardian records where as some kids could have guardians that aren't their parents at all.
    Yes, that's what I have now. A separate student and guardian table. But it doesn't solve the problem because there will be duplicate guardian records in the guardian table.

    E.g. John's father is Bob Jones. So Bob Jones is entered into the Guardian table once
    .
    Later, Jill comes along and her dad is also the same Bob Jones. Bob Jones then gets a duplicate entry into the guardian table, and is listed there twice.

    Thanks.

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

Similar Threads

  1. Capture enter key on password textbox
    By sarnata in forum Forms
    Replies: 2
    Last Post: 09-09-2010, 10:41 AM
  2. one to many relationship?
    By cowboy in forum Access
    Replies: 3
    Last Post: 06-16-2010, 02:37 PM
  3. Capture 2nd Value in an unbound Combo.
    By sesproul in forum Forms
    Replies: 5
    Last Post: 04-30-2010, 02:07 PM
  4. Relationship
    By pcandns in forum Access
    Replies: 2
    Last Post: 04-01-2009, 09:32 AM
  5. MAY TO MANY RELATIONSHIP
    By fadone in forum Database Design
    Replies: 2
    Last Post: 12-20-2005, 09:03 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