What are the ways of preventing duplicate values in a field?
Vague question, but if you are talking about a database field,
the simple way is to create a unique index on the field (if the
database supports it). The index will not allow duplicate values to
be added to the database for that field and will generate an error
if somebody tries.