Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

limiting an input to be from 0 to 10

Status
Not open for further replies.

mcswew

Programmer
Nov 20, 2002
8
0
0
IE
Hi,
This I Know is probably a very simple question but...
I need a validation rule in a database field which limits the integer value that can be entered to be between 0 and 10.
I am trying to use expression builder but my syntax is wrong
something like
0>= AND <=10
can anyone provide the correct expression??
thanks in advance
Willie
 
Thanks Ken,
That did the trick. Like many times before I wonder why I did not get it myself.
I appreciate your help
Willie
 
Is there a way to put a criteria to the validation rule?
ex. This is what I tried on a number fieldl.
>=0 and <=10 where tool_class = "EQUIPMENT"

 
In a word no

It MAY be possible to amend the validation rule property at run time, using VBA code, possibly in the OnCurrent event of the form

eg

Select Case [Tool_Class]
Case "EQUIPMENT"
MyControl.ValidationRule = ">=0 and <= 10"
Case ...etc
End Select


failing that, you will have to do the validation using VBA code

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top