Validation rule in a numeric field of complex expression

M

Mohammed Ali

I was setting up a dbase table with numeric field of
currency type, while in db table design view and I typed
the following in the validation rule of the field
properties: 200 And >=20000 which I meant to limit the
data entry on values between 200 and 20,000 only.

When tested, it showed the following message Syntax error
(missing operator) in table-level validation expression.

When I tried inputting data less than 200, 20500 or even a
normal value within the range, it worked for the Min and
Max even the normal by showing the following error
message: One or more values are prohibited by the
validation rule <rule> set for <name>. Enter a value that
the expression for this field can accept. (Error 3317)

Could you please help out in this matter and tell why,
thanks and best regards. Mohammed Ali
 
D

Douglas J. Steele

To limit the values to the range you want, you need to use
=200 And <=20000

When you create a Validation rule, you tell it what values are valid, not
what values are invalid. And since no value can be equal to 200 AND be >=
20000 at the same time, the rule you had couldn't possibly work.
 

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