Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Location
    North Vancouver, Br. Columbia, Canada
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Having Relationship problems -access relationship! (Access 2000)

    This might be a noob question for you guys but

    Im trying to make a one to many relationship between two tables using 4 fields and enforced referential integrity. Now if i do one field at a time it works fine but doing all 4 at same time it gives me this error:

    No unique index found for the referenced field of the primary table

    Also i don't index if i wanna do many to many right?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Having Relationship problems -access relationship! (Access 2000)

    Your multiple fields have to comprise a unique key before you can enforce referential integrity with another table. Unless you have a unique key on the One side of the relationship, there's no way to enforce referential integrity on the Many side. Many-to-many requires a "join" table in between and that table contains a unique key from each of the other tables. I don't understand your question about not indexing. There isn't any way to create a Many-to-many relationship without unique indexes in the tables being joined.
    Charlotte

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Location
    North Vancouver, Br. Columbia, Canada
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Having Relationship problems -access relationship! (Access 2000)

    charlotte you lost me.

    each field is setup in the one said as unquie. But i doesnt work. What i dont understand is if i do one at a time it works just fine but more than one at a time and it wont do it.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Having Relationship problems -access relationship! (Access 2000)

    Why would you have multiple unique keys in the table? What you need is an index that is set to unique and contains all the fields you need in that unique key and that you want to join to the other table, assuming that all the matching fields are in the many table as well. you can select multiple fields at once from the One table and drag them to the Many table to create the one to many relationship on multiple fields. If you try that and it doesn't work, then you need to tell us what specific message you get. If there is data already in the tables, you won't be able to enforce referential integrity unless the data permits it. If you have records in the Many table that have no match in the One table, then you won't be able to enforce referential integrity.
    Charlotte

  5. #5
    New Lounger
    Join Date
    Feb 2003
    Location
    North Vancouver, Br. Columbia, Canada
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Having Relationship problems -access relationship! (Access 2000)

    thank you so much charlotte. That last post fixed ALL my problems! [img]/forums/images/smilies/smile.gif[/img]
    <3 charlotte!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •