Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding that two fields have the same values

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?

like image 927
user1795322 Avatar asked Jul 08 '26 06:07

user1795322


1 Answers

With your table in Design View, open its Property Sheet and set the table Validation Rule to [field1]<>[field2] like this ...

enter image description here

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.

like image 117
HansUp Avatar answered Jul 09 '26 21:07

HansUp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!