Capture only numeric values in a textbox type character
Posted: Sat Apr 10, 2010 6:33 am
Hi,
I'm trying to capture in a Textbox control, any data such as 001, 005, etc., Then I guess the DataType must be character, but I have not been able to validate that the Textbox control (type character) only allows values from 0 to 9.
I can not use the event LostFocus because validation should be done in "real time", not when the control loses focus.
I tried with the change event of textbox control something like: (This.Value $ "0123456789"), but does not work.
The easiest way to do this would be defining the data type as character and InputMask "999", but ... if I do this, then the control is set as in the picture attached (please take a look), and is something I want to avoid (textbox selection).
Can someone please give me some advice for this implementation.
Please I await your comments.
Best Regards
Javier
I'm trying to capture in a Textbox control, any data such as 001, 005, etc., Then I guess the DataType must be character, but I have not been able to validate that the Textbox control (type character) only allows values from 0 to 9.
I can not use the event LostFocus because validation should be done in "real time", not when the control loses focus.
I tried with the change event of textbox control something like: (This.Value $ "0123456789"), but does not work.
The easiest way to do this would be defining the data type as character and InputMask "999", but ... if I do this, then the control is set as in the picture attached (please take a look), and is something I want to avoid (textbox selection).
Can someone please give me some advice for this implementation.
Please I await your comments.
Best Regards
Javier