This stops me from typing text, but how would i be able to write text and stop numbers?
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
Beep
End If
Printable View
This stops me from typing text, but how would i be able to write text and stop numbers?
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
Beep
End If
Since your using VB3 you don't have the constants but this code works.
Code:If KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Then
KeyAscii = 0
End If
maybe you can use the isnumeric-function...
Check your msdn help about this !
ex.
---------------------------------------
If IsNumeric(text1.text) True Then
'It's numeric !
Else
' It's Not !
End If
---------------------------------------
IsNumeric didn't exist in VB3Quote:
Originally posted by Red Thread
maybe you can use the isnumeric-function...
Oeppssss
Don't know if VB3 has this function...
I'll doubt it
Isnumeric allows some special characters -+ and DE, so i suggest you compare with like operator:
Code:If not (text1 like "*#*") then 'contains numbers
Thanks got it to work, and kedman thanks for that post that was my next question!