Reputation: 31
I am using Access 2010.
I have a Table named Person
: Id(key), field1(int), field2(int)
.
I want to avoid that field1
will be equal to field2
.
Is this possible?
Upvotes: 3
Views: 297
Reputation: 97131
With your table in Design View, open its Property Sheet and set the table Validation Rule to [field1]<>[field2]
like this ...
Note that if you omit the square brackets surrounding the field names, Access may convert them to text values ... "field1"<>"field2"
. You don't want that.
BTW, I typically change the Subdatasheet Name property to [None]
, but that's not an issue related to the Validation Rule.
Upvotes: 5