Validation Rule for maximum length

U

UT

I am trying to add a validation rule in a field that should not allow a null
value and also check that only alphabets are entered. I added following
validation rule.

Is Not Null And <>"" And Like "*[A-Z]*" And Not Like "*[0-9]*"

It checks if a digit is entered and displays the validation text but does
not check for emtpy row and allows null entries.
What do I need to change in the above validation rule so both conditions are
checked.

Thanks
 
6

'69 Camaro

Hi.
I am trying to add a validation rule in a field that should not allow a
null
value and also check that only alphabets are entered.

Try:

Is Not Null And Not Like "*[!A-Z]*"

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.


UT said:
I am trying to add a validation rule in a field that should not allow a
null
value and also check that only alphabets are entered. I added following
validation rule.

Is Not Null And <>"" And Like "*[A-Z]*" And Not Like "*[0-9]*"

It checks if a digit is entered and displays the validation text but does
not check for emtpy row and allows null entries.
What do I need to change in the above validation rule so both conditions
are
checked.

Thanks
 
B

BruceM

An input mask may be a simpler way of getting what you need. LLL as the
input mask would require three letters. Help has more information.
To use validation, if you set the Required property for the field to Yes and
Allow Zero Length to No, the rest of the rule:
Like "*[A-Z]*" And Not Like "*[0-9]*"
should work for the rest.
 
U

UT

Thanks for all your suggestions. It worked.

BruceM said:
An input mask may be a simpler way of getting what you need. LLL as the
input mask would require three letters. Help has more information.
To use validation, if you set the Required property for the field to Yes and
Allow Zero Length to No, the rest of the rule:
Like "*[A-Z]*" And Not Like "*[0-9]*"
should work for the rest.

UT said:
I am trying to add a validation rule in a field that should not allow a
null
value and also check that only alphabets are entered. I added following
validation rule.

Is Not Null And <>"" And Like "*[A-Z]*" And Not Like "*[0-9]*"

It checks if a digit is entered and displays the validation text but does
not check for emtpy row and allows null entries.
What do I need to change in the above validation rule so both conditions
are
checked.

Thanks
 

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