How can I prevent entering duplicate records?

nitinrao

Registered User.
Local time
Today, 07:04
Joined
Dec 17, 2009
Messages
26
Hi everyone!

I have several fields in my table "Employees". But I want to make sure that a user doesn't enter the same employee information twice...more specifically, I'm not trying to prevent a single field (like "Last Name") but trying to prevent duplicating the record (which includes all the other fields...because some people may have the same last name or first name).
How can I go about doing so?
 
Put a unique key on the fields that make a record unique. You can do this from the table design and find the key tool (different place for different versions). Pick a name for your key and apply that name to all the unique fields.
 
Put a unique key on the fields that make a record unique. You can do this from the table design and find the key tool (different place for different versions). Pick a name for your key and apply that name to all the unique fields.

But I want the entire record to be unique - not just a field or two...For example, I have another table called "Keys". There are fields called "Building" and "Room". There are two buildings, and the two buildings have overlapping room numbers because they are separate buildings....therefore, I'm trying to make the whole record be unique, not just "Building" or "Room"
 
Trying to make the whole record unique is somewhat of an overkill, if you don't mind me saying. What you need to do is to select certain key fields,like surname, forename, DOB, etc and test for them when any of the key fields are either changed or added. You can do this be using DLookups or recordset filters.

David
 

Users who are viewing this thread

Back
Top Bottom