Capture only numeric values in a textbox type character

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

Capture only numeric values in a textbox type character

Post by jparada »

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
Attachments
textbox_selection.png
textbox_selection.png (312 Bytes) Viewed 2458 times
Post Reply