No unique index found for the reference field of the primary table."

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jinalpatel
    New Member
    • Mar 2008
    • 68

    No unique index found for the reference field of the primary table."

    I am getting this error when I try to enforce referencial integrity from Harvest II table to tractsum table I have attached the relationship diagram. Please give me the hint about possibilities of situation why this error occurs?

    Thanks
    Attached Files
  • RuralGuy
    Recognized Expert Contributor
    • Oct 2006
    • 375

    #2
    Does the Harvest II table have a PrimaryKey field?

    Comment

    • jinalpatel
      New Member
      • Mar 2008
      • 68

      #3
      Yes primary key is Property. It is one to many relationship. One Property can have multiple tract_sum.

      Comment

      • RuralGuy
        Recognized Expert Contributor
        • Oct 2006
        • 375

        #4
        Why are there two fields from the Harvest II table in the TractSum table? What is the DataType of these fields?

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32656

          #5
          Your attachment doesn't show the details of the link, but I suspect you have no unique index specified for the fields [Property] & [Comp_Tract 1] (taken together as a composite key).

          Must they be unique? If so, define the index and you should be able to proceed past that point I would guess.

          Comment

          • jinalpatel
            New Member
            • Mar 2008
            • 68

            #6
            Thanks you much guys!!
            I found that there was no unique index set up for both the primary (composite key - in the table properties) I set that property to yes(with no duplicates) and it gave me another error saying that there is duplicate data in the table. I removed the duplicate data and it allowed me to enforce referencial integrity..Alth ough it is weired that I tried 2-3 time before and it didn't work but finally it works fine.
            Thanks much!!

            Comment

            • RuralGuy
              Recognized Expert Contributor
              • Oct 2006
              • 375

              #7
              Thanks for posting back with your success.

              Comment

              Working...