• Register
1 vote
161 views

Problem :

I am very new to database programming. I have recently started learning about databases. Currently I am desperately trying to create the database somehow for a very first time. I have already designed all of my tables. Now I am trying to create their relationships. But I am often facing below error.

“No unique index found for the referenced field of the primary table.”

Now I am very confused about above error message and I have already spent lot of time in researching and trying to fix above error but till now unable to fix it. So I am looking for database expert who can suggest me the quick fix for my above error.

9 6 2
3,980 points

Please log in or register to answer this question.

2 Answers

1 vote

Solution :

I have a lot of experience in database programming so trying to help you. I think the access is trying to tell you that you have forgot to created the way for your table to force the uniqueness in a field which you are trying to use to relate your table to your other table.

So if you are willing to create the relationships with the help of Referential Integrity enforced then your field on your "Main" side of a relationship should be either the Primary Key of your that table or you should have the Unique Index applied to your desired table. So to fix your issue you need to simply open your table in the design view and then just do one of the suggested two things.

5 4 2
17,150 points
0 votes

Solution:

You are perhaps attempting to enforce referential integrity, which you cannot do in this state. In case you were not told to do that, then don't and the message must go away.

For what it's worth, the assignment requisite appear bizzare. A PO table must be a header with PO number, make date, status.  A PO line items table is where part numbers or their reference ID's should go.

The field in the table on the One-side of the relation should have a unique index. A duplicate index is not sufficient.

This is perhaps a gap in your understanding of relational database design. Please give us a enough description of the tables in question and their significant fields and data types.

In case you want to enforce referential integrity for a relationship, there should be a unique index (for example the primary key, however it can also be another index, as long as it is unique) on the field(s) on one side of the relationship. In case there is no such index, Access cannot enforce referential integrity.

I figure out the gap in my understanding of relational database design is explicit. It is plainly an area I am struggling with. In terms of the tables in in question, I have a table, "SampleDate" with 12 fields that I intend to join to 27 other tables named "element1", "element2", "element3" etc that comprise weather data.

The SampleDate table comprise the following fields:

  1. ID, which is autonumbered, and indexed as "Yes (No Duplicates)"
  1. Climate ID, which as explained prior is not a primary key, structured as "short text" data type and comprises alphanumeric data, and indexed as "Yes (Duplicates OK)". Climate ID's illustrate a weather station and may be periodic cause there are weather readings for each date (for example weather readings from each day of a month for one weather station)
  1. Date, which is not a primary key, and structured, structured as "Date/Time" data type and shown as long date, and indexed as "Yes (Duplicates OK)". Dates may be periodic as there can be readings from several weather stations on any given day.
  1. Weather parameter such as "Air Temp" (element 1), "Imply Wind Speed" (element 2), "entire Snowfall" (element 3) 

What I am necessary to do is link my master list of dates "SampleDates" to each element and trace out the pertinent weather data as it relates to climate ID and date.

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

10 6 4
31,120 points

Related questions

0 votes
1 answer 7 views
7 views
Problem: Can anyone tell me the solution of this problem? unique/primary keys in table referenced by foreign keys
asked Apr 7 Ifra 37.2k points
1 vote
1 answer 314 views
314 views
Problem : I am learning Oracle and trying to create and drop tables. If I try to drop my table it is always showing me below error: DROP TABLE SUBURB; DROP TABLE CITY; DROP TABLE STATE; Error at line 1: ORA-02449: unique/primary keys in table referenced ... already used by an existing object. I am unable to understand the above errors. Can someone guide me in fixing above Oracle related errors?
asked May 12, 2020 Martin K 6.6k points
0 votes
2 answers 797 views
797 views
Problem : I am trying to create the table but facing below error “Error: There is no unique constraint matching given keys for referenced table.” How to fix the above error?
asked Jan 21, 2020 jwilliam 3.9k points
0 votes
1 answer 5 views
5 views
Problem: This issue is bugging me, please solve this >How to add a calculated field to a query in access 2013?
asked 6 days ago Danyal Sjoerd 7.1k points
0 votes
1 answer 4 views
4 views
Problem: How to List Field's Name in table in Access Using SQL?
asked Apr 16 sumaiya simi 43.9k points
0 votes
1 answer 3 views
3 views
Problem: I am having problen on how to make a calculated field in access?
asked Apr 12 ashik 14.6k points
0 votes
1 answer 6 views
6 views
Problem: Someone help me to fix this Please on > 'how to create a new field in access' ?
asked Mar 17 sadi1982 36.3k points
0 votes
1 answer 5 views
5 views
PROBLEM : Is there anyone to helo on > 'how to add a field in access 2013' ?
asked Mar 17 Samiur1 38.4k points
0 votes
1 answer 7 views
7 views
PROBLEM : Please help me on > 'how to add a new field in access design view' ?
asked Mar 17 Samiur1 38.4k points
0 votes
1 answer 15 views
15 views
there are no primary or candidate keys in the referenced table
asked Feb 16 ArifulIslam 7.5k points