How can I make Access think there is a primary key

Posted by user3692757 on Stack Overflow See other posts from Stack Overflow or by user3692757
Published on 2014-05-30T21:00:06Z Indexed on 2014/05/30 21:26 UTC
Read the original article Hit count: 196

Filed under:

I have a table and I'm trying to join it with another table, but it doesn't have a distinctive primary key. The two tables do share similarities, “Acct” and “Location”. If I could concatenate “Acct&Location” it would become a primary key, but Access won’t let me make a primary key from a calculation.

I provided a small sample below.

Each hospital has an “Acct”, but the “Acct” will show up once for each “Location”. How can I make join these in a relationship? I connected the two in a relationships and tried to “Enforce Referential Integrity”, but it indicated “No unique index found for the referenced field of the primary key”.

Also, if I run a “Find UnMatched Query” it doesn’t find anything. I think its because I can’t make it realize that in combination “Acct” and “Location” can be perceived as primary keys when used in conjunction of each other.

Acct 1 2 3 1 2 3 1 2 3|

Location ABI ABI ABI NHO NHO NHO NTX NTX NTX

I tried to load an image to illustrate it better, but I haven't made enough post.

© Stack Overflow or respective owner

Related posts about primary-key