Only alphabets

  • Thread starter Thread starter Tausif
  • Start date Start date
T

Tausif

Hi all gurus,

I have user id field in a user table I want to restrict the field to accept
only Alphanumeric values without any space. How can I put this restriction
at db level? please guide. Thankx.

Tausif
 
Tausif said:
Hi all gurus,

I have user id field in a user table I want to restrict the field to
accept only Alphanumeric values without any space. How can I put this
restriction at db level? please guide. Thankx.

"No spaces" is easy: in the table's design view, create a Validation
Rule for the field, like this:

Not Like "* *"

You could also set the Validation Text property to

No spaces, please!

or such other message as you might like.

On the other hand, if what you really want is to restrict entry to only
alphabetic (A-Z) or numeric (0-9) characters, then you'd want a
validation rule like this:

Not Like "*[!a-z0-9]*"

Note that there is no distinction made between lower- and upper-case
letters.
 
Back
Top