How to validate rule the Texbox of Microsoft Access?
To have validation rule in Form specifically in textbox. Try to do the example bellow. Open your Form to design mode. Select the textbox that your going to make validation. Then click the data in property, find the validation rule and valiation text.
Example:
ValidationRule property | ValidationText property |
---|---|
<> 0 | Entry must be a nonzero value. |
> 1000 Or Is Null | Entry must be blank or greater than 1000. |
Like "A????" | Entry must be 5 characters and begin with the letter A. |
>= #1/1/96# And <#1/1/97# | Entry must be a date in 1996. |
DLookup("CustomerID", "Customers", "CustomerID = Forms!Customers!CustomerID") Is Null | Entry must be a unique CustomerID (domain aggregate functions are allowed only for form-level validation). |
From the example above the textbox only allowed 5 digits using Like "?????".
Try to experiment from your side using the others validation rules.
Example:
Your experience on this site will be improved by allowing cookies.