validation dependencies

G

Gabe

Hello,

I want to prevent duplicate record entries based on a field.

For example, I have a table with an "employeename" field and a "round"
field. If a user enters the record "John Doe" for employeename and "1" for
round, then the user must not be allowed to enter the same thing twice. "John
Doe" can only be entered again if the user specifies a different round (e.g.,
2,3,4,5,etc). So in other words, the table is only allowed to have 1 name per
round. When the user trys to input a duplicate record, there could be a
message that says: "this employee has been previously loaded" or something
like that.

Does anyone out there know how to code something like this? I'm using Access
2003.

Thanks,
~Gabe
 
J

John W. Vinson

Hello,

I want to prevent duplicate record entries based on a field.

For example, I have a table with an "employeename" field and a "round"
field. If a user enters the record "John Doe" for employeename and "1" for
round, then the user must not be allowed to enter the same thing twice. "John
Doe" can only be entered again if the user specifies a different round (e.g.,
2,3,4,5,etc). So in other words, the table is only allowed to have 1 name per
round. When the user trys to input a duplicate record, there could be a
message that says: "this employee has been previously loaded" or something
like that.

Does anyone out there know how to code something like this? I'm using Access
2003.

Thanks,
~Gabe

Do note that in addition to Ken's suggestion there is a possible problem with
your design: names are NOT unique! You could have a record for Karen Smith,
the Chief Financial Officer, and for Karen Smith, the trainee mail clerk (no
relation). Your employee table should - must, I'd say - have a unique
unambiguous EmployeeID. You can create a joint two-field index on the
employeeID and the Round.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top