How do i write this in VB....??
"only numeric keys to be entered into my field....and vice versa....how do i allow only alpha keys to be entered into my field..."
tia
--------------------------
THANKS
Printable View
How do i write this in VB....??
"only numeric keys to be entered into my field....and vice versa....how do i allow only alpha keys to be entered into my field..."
tia
--------------------------
THANKS
You could use a regular expression to do it, but the easiest would be just simply use IsNumeric()
well if your using a textbox then you could go,
VB Code:
Private Sub Text1_KeyPress(KeyAscii As Integer) If Not (KeyAscii < 48 Or KeyAscii > 57) Then KeyAscii = 0 End If End Sub
for no numeric values to be entered and remove the NOT for vice versa