I have a field defined as short text and the length is 14. i have set the validation rule =14 with a validation text saying this field should be 14 characters. Yet on entering exact 14 characters i get the error message and since the field is set as required, it does not allow me to proceed. what could have gone wrong. please help.
Your validation rule might be better if you used "IsNull(Token1) or len(Token1) = 14". The user can either enter nothing or a 14-character string.
Mohammed Aslam KhanOP
@Reply 2 years ago
Mohammed Aslam KhanOP
@Reply 2 years ago
Jennifer Neighbors
@Reply 2 years ago
When you entered the new validation rule, did you place square brackets around the field name "Token1"? Sometimes, Access will put quotes around the field name, and you need to replace them with square brackets to indicate you're referring to a field name. If Access puts "Token1", you replace it with [Token1].
Juan C Rivera
@Reply 2 years ago
use VBA afterupdate validate
IF len([filed name here]) >14 or len([filed name here]) <14 then
msgbox "validation msg here"
exit sub
end if
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Beginner 2.