You can put a check constraint on a field using this sort of command in the immediate window.
However, I have seen no simple way to know what constraints exist. So if you add such a constraint document it well.
Here I am putting a check constraint (check this before adding a record to this table) to restrict InputRange to 1,2 or 3 on Table JPersons
Code:
CurrentProject.Connection.Execute "ALTER TABLE JPersons ADD CONSTRAINT chk_Range CHECK (InputRange>=1 and InputRange <=3);"
I used this code to Drop the constraint
Code:
CurrentProject.Connection.Execute "ALTER TABLE JPersons DROP CONSTRAINT chk_Range"
Also, I just added the validation rule to the table as per the attached jpg.
And an example of the validation error that results if you attempt to enter a value outside the permitted range.