PDA

Click to See Complete Forum and Search --> : Mask edit box and numbers


willye
Nov 24th, 1999, 08:06 PM
How can I know if the text of a mask edit box has no letters in it? (I just want numbers) A mask doesn't work because I want numbers with 2 decimals and it's not a good thing to put a mask like 9999999.99 (if you know what I mean. The data entry is not practical, you can't type the . anywhere like in, say, Fox)
Thanks!!

QWERTY
Nov 24th, 1999, 08:18 PM
if MaskEdBox doesn't make any sense to you why won't you use TextBox????

If it works for you here is the code to not allow letter:

Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not IsNumeric(Chr(KeyAscii)) And Chr(KeyAscii) <> "." Then
KeyAscii = 0
End If
End Sub


Hope this will help

------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.

HeSaidJoe
Nov 25th, 1999, 02:36 AM
MaskEdit1.Mask = "######.##"
or however many.
ie..# for numbers
? for alphaa

A mask will not allow anything but what is maksked.