Validation Rule Problem

  • Thread starter Thread starter CSDunn
  • Start date Start date
C

CSDunn

Hello,
I need to set up a validation rule so that a field accepts only the
following characters; '+', '*' and '-'.

When I attempt to set up a Validation Rule this way, the only syntax that I
have found to work is as follows:

"+" OR Like "*' OR "-"

The problem is the 'Like "*" ' allows for any character.

How can I express these three characters as the only valid characters for
entry?

Thanks!

CSDunn
 
Hello,
I need to set up a validation rule so that a field accepts only the
following characters; '+', '*' and '-'.

When I attempt to set up a Validation Rule this way, the only syntax that I
have found to work is as follows:

"+" OR Like "*' OR "-"

The problem is the 'Like "*" ' allows for any character.

How can I express these three characters as the only valid characters for
entry?

Try ... Or Like "[*]" Or ...

Peter
 
CSDunn said:
Hello,
I need to set up a validation rule so that a field accepts only the
following characters; '+', '*' and '-'.

When I attempt to set up a Validation Rule this way, the only syntax
that I have found to work is as follows:

"+" OR Like "*' OR "-"

The problem is the 'Like "*" ' allows for any character.

How can I express these three characters as the only valid characters
for entry?

Thanks!

CSDunn

Access is misinterpreting your use of the "*" character to mean you want
a wild-card comparison. Try entering this in the Validation Rule to set
Access straight:

"+" Or ="*" Or "-"

This is going to mean that the field can only hold one character, which
must be one of those three. Is that what you wanted, or did you mean
that it could contain a string of multiple characters, so long as
they're all drawn from that set?
 
Thanks for your help! CSDunn

Dirk Goldgar said:
Access is misinterpreting your use of the "*" character to mean you want
a wild-card comparison. Try entering this in the Validation Rule to set
Access straight:

"+" Or ="*" Or "-"

This is going to mean that the field can only hold one character, which
must be one of those three. Is that what you wanted, or did you mean
that it could contain a string of multiple characters, so long as
they're all drawn from that set?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top