Link to home
Start Free TrialLog in
Avatar of Megin
Megin

asked on

Quick Access Question about Primary/Composit Keys

I have a table in access and I need to prevent duplicates when two of the fields are duplicated.

So, if just one of them is repeated it is fine. The problem is when a combination of fields are duplicated. Example:

Fields: Lname, Fname, DOB

It is okay if any of those are duplicated on their own. But if Lname and Fname, or Lname and DOB match another record in the table, the table should reject the new record.
Avatar of jerryb30
jerryb30
Flag of United States of America image

Are you wondering how to do that, or if you can have both with the same field (Lname)? Or have two composite keys, with no duplicates?
Avatar of Megin
Megin

ASKER

I am wondering how to do that with Access. I see that I can set a particular field to not accept duplicates and I could set others to not accept duplicates, but I want to make it so that the combination of two fields won't accept duplicates.
ASKER CERTIFIED SOLUTION
Avatar of jerryb30
jerryb30
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Megin

ASKER

Perfect!  Thank you!

I would not have found that on my own.