Barb Miles said:
We cannot set the Indexed property to Yes (No Duplicates) in this case or set
it as the Primary Key.
Can anyone give me the steps to set up a Validation Rule?
You cannot do what you want with a Validation Rule defined in the table. You
could however use a Validation Rule on the control bound to this field on a
form. From the help file...
For controls, you can set the ValidationRule property to any valid expression.
For field and record validation rules, the expression can't contain user-defined
functions, domain aggregate or aggregate functions, the CurrentUser or Eval
function, or references to forms, queries, or tables. In addition, field
validation rules can't contain references to other fields.
If I were doing this on a form I would prefer to use the BeforeUpdate event with
some VBA code as I would have more control and flexibility in writing the
validation test. In a validation rule I assume you would have to use DCount()
to return the number of rows with the same value and test that it returns zero.
Can you explain why a unique index cannot be used?