Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation Rule to allow hyphen, exclude other special characters 1

Status
Not open for further replies.

mlev

Programmer
Mar 1, 2010
9
US
I'm a bit confused on how to properly format a validation rule for an Access form. The rule I've been using to exclude special character is:

Is Null Or Not Like "*[!((a-z) or (0-9) or (.))]*"

I copied that from a site online and I'm not sure why the double-negative is necessary, but it does work.

The problem is that now I need to allow users to input a dash or hyphen "-" and I can't seem to add that in. Obvious things like this do not work:

Is Null Or Not Like "*[!((a-z) or (0-9) or (-) or (.))]*"

Any assistance is appreciated. Would a module with a function for validation work better for this purpose?
 
Something like this ?
Is Null Or Not Like "*[!-a-z0-9.]*"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top