Validation Text Problem

S

Sam Solomon

Dear All,

I am using a validation rule ^[0-9]*$ in my TextBox on Access form which
allows only Numbers to be entered in the TextBox. How ever it doesnt seem to
be working.And I am geting "Please enter Numbers only" validation text every
time I enter anything in the textbox.

Any idea whats going on.

cheers,
Sam Solomon
 
V

Van T. Dinh

It may be simpler to use the TextBox_BeforeUpdate Event and check whether
the entry is numeric or not using the IsNumeric() function.
 
J

John Spencer

IsNumeric is generally accurate, but there are exceptions to the rule of
only numbers.

IsNumeric("1d10") is True
IsNumeric("1e10") is True
IsNumeric("-10") is True

I usually use a custom function to check each character in the string using
IsNumeric.

Van T. Dinh said:
It may be simpler to use the TextBox_BeforeUpdate Event and check whether
the entry is numeric or not using the IsNumeric() function.

--
HTH
Van T. Dinh
MVP (Access)



Sam Solomon said:
Dear All,

I am using a validation rule ^[0-9]*$ in my TextBox on Access form which
allows only Numbers to be entered in the TextBox. How ever it doesnt seem
to
be working.And I am geting "Please enter Numbers only" validation text
every
time I enter anything in the textbox.

Any idea whats going on.

cheers,
Sam Solomon
 
Top