Results 1 to 4 of 4
  1. #1
    stevenm is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Posts
    2

    doing a many to many with twice the same table

    Hi all,



    it is my first post here as I am begginging in Access.

    I have a database with people. I would like to create a subtable for people indicating the links between them (such as, brother, father, friend etc...)

    I have created an associate table taking person1ID (as foreign key), person2ID (as foreign key) and relationship (a simple drop down textbox).

    The problem I have is creating a query Is it does not seem to differentiate person1 to person2?

    any help would be wonderful.

    thank you

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    The tPerson table has a ParentID field....
    Comes from the tParents table
    [ ParentID],[FatherID],[MotherID]

    collect all children with same ParentID, gender will dictate Sister ,Brother.

  3. #3
    stevenm is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2016
    Posts
    2
    Thanks Ranman for your quick reply.

    I am not sure this will work... I would like at the end having a subtable on tperson that shows all the other persons with whom he has a link.

    It is more than just brother and sister, we can have cousin, firends, Girl friend, school friend etc....

    thanks

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    I just gave you the setup, youd build queries to determine relations.
    otherwise youd have tPerson-> tPerson -> tPerson ,....to infinity.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-31-2016, 03:33 AM
  2. Replies: 4
    Last Post: 08-30-2012, 07:58 PM
  3. Replies: 8
    Last Post: 03-22-2012, 08:48 AM
  4. Replies: 2
    Last Post: 08-01-2011, 11:35 PM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 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