Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit to unique records based on combination of two fields?

Status
Not open for further replies.

KerryL

Technical User
May 7, 2001
545
US
I'm creating a database that will track customer calls and their requests and want to avoid creating duplicate master records for the same customer. Customers are entered into the database using their first and last name (in separate fields).

What's the best way to have access check to see if the customer already exists in the customer table? Can I have Access limit a combination of the first and last name fields to unique records? If so, how? Or if there's a better way, please let me know.

If I change the LastName field properties to accept only unique records I won't be able to enter multiple customers with the last name. What I'd like to do is have access deny the ability to enter a new customer if one with the same first and last name already exists. (Actually, in reality, two Jim Smiths could call and be valid, provided their address is different. Maybe I should limit the address field to unique records?)

Thanks in advance for any advice you can give me.

KerryL
 
Hi Kerry!

I would select the First and Last Names and the Phone number combined to be the primary key. Usually those three together make a unique combination and most people have no trouble giving you their phone number. If you set those three fields as a combined primary key Access will make sure no duplicates are added.

hth Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top