Record duplicates!

daneo2k3

Registered User.
Local time
Today, 05:15
Joined
Nov 27, 2003
Messages
81
Hi i have a form where you can add a date and locaction were an employee is example:

DATE EMPLOYEE LOCATION

01/10/03 Jon Jones BP Cleeton
01/10/03 Mike Smith GDF Anglia
02/10/03 Jon Jones Holiday

This works fine but you can sometimes enter the same date twice for the same employee so you have a duplicate record i want it to not allow the same date and name is this possible while allowing me to have the same date more than once but different employees?? can anyone help cheers dane
 
Is the employee name and date being stored in the same table? If so, I'd suggest using both as the primary key for the table so that Access will automatically disallow adding the same employee/date combination more than once.

Otherwise, you can use a DCount function to test for the pre-existence of an employee/date combination before allowing the record to be added to your database.
 
cheers the primary key worked a treat cheers dane
 

Users who are viewing this thread

Back
Top Bottom