Results 1 to 6 of 6
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Citeria MS Access 2010 uses for selectig the type of realtionship in edit realtions dialogue box

    How does MS Access determine what kind of relationship (one-to-one, one-to-many, many-to-many) when you draw the line from primary key to foreign key and then it selects the type of relationship from one of the three listed above.



    I know that if both have indexes (primary and foreign key) do not allow duplicates then that is a one-to-one relationship. It seems that it is arbitrary.

    Is there a link that discusses this in detail?

    Any help appreciated. Thanks in advance.


    Respectfully,


    Loou Reed

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Its how you keyed the tables. And your join.
    IF the key allows many items in the child then it will be many.

  3. #3
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, as I said when you allow indexes with no duplicates (on both keys) then you get a one-to-one. But that is all I know. Could you expand yours a little more? I am only going by indexes, there must be more?

    Thanks in advance.

    Respectfully,

    Lou Reed

  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
    53,771
    If you set a field in one table as Primary with Index (No duplicates) and field in other table as allow duplicates then when you create the line in Relationships builder, Access 'knows' what the relationship is.
    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.

  5. #5
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, in this specific case you wrote what is the relationship; it clearly is not one-to-one.

    R,


    Lou Reed

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Right.

    So this explains and clarifies what happens?

    If you don't set a field on one table as primary and then link to another field - what happens?

    Do some experimenting.

    I suggest that if there is not enough info to know otherwise, Access will default to 1-to-1.

    I just did an experiment. Did not quite get what I expected.

    I linked PK with FK and the dialog says Relationship Type: One-To-Many (that was expected); however, the JOIN Type defaults to INNER. So, YOU define the JOIN Type you want as default when a query is built.
    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: 3
    Last Post: 10-02-2015, 07:58 PM
  2. Replies: 1
    Last Post: 08-11-2015, 11:33 AM
  3. Access 2010 Type mismatch
    By iMaCannot in forum Programming
    Replies: 15
    Last Post: 09-30-2014, 01:54 AM
  4. Replies: 1
    Last Post: 09-11-2012, 05:43 AM
  5. Replies: 1
    Last Post: 08-11-2011, 11:42 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