Search code examples
databasems-accessms-access-2007ms-access-2010ms-access-2013

"Validation Rule" in MS Access for a string column for having only numeric digits


Is it possible to have a "Validation Rule" in MS Access for a column of text/string data type that allows only numeric digits? And a "Validation Rule" that allows only alphabets?


Solution

  • For a rule that will only allow numeric digits you can use. Is Null OR Not Like "*[!0-9]*" This will reject anything that is not a number. You can do the same thing with alpha characters with Is Null OR Not Like "*[!a-z]*"

    Have a look at this link for more examples of what you can do with validation rules. If you are restricting a field to only allows numeric digits why not make the field numeric?