Expr. Box

J

Jone

Hi ,

What do I write in the expr. box when I want that there "must" be a value in
the field and it "must be between the number 0 and 1" ?
 
J

John W. Vinson

What do I write in the expr. box when I want that there "must" be a value in
the field and it "must be between the number 0 and 1" ?

Make the field (which will need to be a Single, Double, Currency or Decimal
number, certainly not the default Long Integer) Required, and in its
validation rule put
= 0 AND <= 1

That's if 0 and 1 are legitimate values; if you want to exclude the limits use
and < instead of >= and <=.

In the ValidationText property put whatever message you want the user to see
if they enter 3.1415926535 or some other unwanted value.

John W. Vinson [MVP]
 
J

Jone

Thanks for your reply!
The problem is that I want that a number MUST be entered in that field and
the expression that you wrote only filters it between 0 and 1, and if I leave
it empty nothing will happen.
 
B

Beetle

Did you set the required property of the field, as John suggested?
--
_________

Sean Bailey
 
B

Beetle

If the required property is set to true, then the record cannot be saved if
the field contains a null value. If you are able to save the record then the
field is not null, probably a zero length string, so try setting "Allow Zero
Length String" to no.
--
_________

Sean Bailey
 
J

Jeanette Cunningham

Hi,
Open the table in design view.
Put the cursor in that field and look down to the bottom of the table, you
should see a tab called general.
There will be a list of properties down the left side starting with
FieldSize for that text field.
One property is called Required
Underneath Required is the property called Allow Zero Length

Jeanette Cunningham
 
J

Jone

It's still not working

Jeanette Cunningham said:
Hi,
Open the table in design view.
Put the cursor in that field and look down to the bottom of the table, you
should see a tab called general.
There will be a list of properties down the left side starting with
FieldSize for that text field.
One property is called Required
Underneath Required is the property called Allow Zero Length

Jeanette Cunningham
 
J

John W. Vinson

It's still not working

That's not helpful, Jone.

What are you doing?
What's happening?
What do you WANT to happen?

You may want to modify the validation rule to

IS NOT NULL AND >= 0 AND <= 1


John W. Vinson [MVP]
 
J

Jone

Great It Worked !

John W. Vinson said:
That's not helpful, Jone.

What are you doing?
What's happening?
What do you WANT to happen?

You may want to modify the validation rule to

IS NOT NULL AND >= 0 AND <= 1


John W. Vinson [MVP]
 

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