Validation Rule - Any character outside the range A to Z is rejected.

S

suzy.may

I would like to use the this validation rule Is Null Or Not Like "*[!a-
z]*"

Hwever my data base needs to accomodate spaces between the letters,
but excludes all other punctuation. What do I add and where do I add
it?
 
S

strive4peace

Hi Suzy,

You can use the ValidationRule property to specify requirements for data
entered into a record, field, or control. When data is entered that
violates the ValidationRule setting, you can use the ValidationText
property to specify the message to be displayed to the user.

ValidationRule --> Is Null Or Like "[a-z,"" ""][a-z,"" ""][a-z,"" ""]"

the above is for 3 letters or spaces -- problem is that it MUST be 3
characters long


it would be better to use a form and use the control BeforeUpdate event
... you could use code to test each character and it could be any length



Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
A

AaronKempff

I would like to use the this validation rule Is Null Or Not Like "*[!a-
z]*"

Hwever my data base needs to accomodate spaces between the letters,
but excludes all other punctuation. What do I add and where do I add
it?

Crystal is a great human being but she hasn't understood your
validation rule. Yours is much clever than her's, it's a clever one!
Forgive her, for she works hard.

You need to add a space into your pattern but watch spaces in the
wrong place:

Is Null Or (Not Like "*[!a-z ]*" And Not Like " *" And Not Like "* "
And Not Like "* *")

Have an even awesomer day! :))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top