Validation Rule for an *

H

Haff

I'm using ACCESS 2003 and don't want the user to enter any * in the field.
(This is a character, not a wildcard.) In FORMS, DESIGN VIEW, PROPERTIES,
VALIDATION RULE, I'm entering (among several permutations):
= [Case Name] Not Like "*"

It doesn't work. Any suggestions? Thx.
 
D

Dirk Goldgar

Haff said:
I'm using ACCESS 2003 and don't want the user to enter any * in the field.
(This is a character, not a wildcard.) In FORMS, DESIGN VIEW, PROPERTIES,
VALIDATION RULE, I'm entering (among several permutations):
= [Case Name] Not Like "*"

It doesn't work. Any suggestions? Thx.


Try:

Not Like "*[*]*"
 
J

John W. Vinson

I'm using ACCESS 2003 and don't want the user to enter any * in the field.
(This is a character, not a wildcard.) In FORMS, DESIGN VIEW, PROPERTIES,
VALIDATION RULE, I'm entering (among several permutations):
= [Case Name] Not Like "*"

It doesn't work. Any suggestions? Thx.

The LIKE operator is treating it as a wildcard. This rule will fail for a
couple of reasons! If your field only has one character and you want that
character to NOT be an asterisk use a validation rule of

<> "*"

If you want to prevent entry of an asterisk anywhere within a longer field,
you need to wrap the asterisk in square brackets so that LIKE will realize you
mean it literally:

NOT LIKE "*[*]*"

The leading and trailing asterisks mean you want to exclude a literal asterisk
anywhere within a string of other characters.
 

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