English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-08-11 05:03:22 · 5 answers · asked by Anonymous in Computers & Internet Programming & Design

valid: abcde
invalid: 12345
a2c3e
~!@#$

2006-08-11 05:35:15 · update #1

5 answers

Each and every character has its own unique ascii number.
I assume that you are using a text box to input the values.
Furthermore You do not want any Numbers. You can use the code below as well.It is written in key press event

Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii <= 48 or KeyAscii >= 57) Then
Text1.Locked = False
Else
Text1.Locked = True
End If
End Sub

The number 0 has an ascii value of 48
1 has 49 and so on till 9 has 57.
Hence the above code

In case you want to know the ascii of any character
Use the following code in the keypress event


Private Sub Text1_KeyPress(KeyAscii As Integer)
MsgBox KeyAscii
End Sub

This will display the ascii of whatever key you have pressed.

2006-08-11 17:32:11 · answer #1 · answered by cmr 3 · 0 0

On Error GoTo Err:

' Validation Code

Exit Sub

Err:

'Error handler

End Sub.

2006-08-11 05:39:32 · answer #2 · answered by ag_iitkgp 7 · 0 0

I use Visual Studio .NET 2005 (.NET Framework 2.0), to do what you're asking is easy. I'd use a masked inputbox. I believe all VB have it. If not, at the very least I'd upgrade to .NET 2005.

2006-08-11 05:44:18 · answer #3 · answered by mlw4428 3 · 0 0

alphanumerical?

if neither alphabetical (a-z), numerical (0-9), AND special characters (!£$#) are allowed - then what characters ARE allowed?

your question can't be answered until it is more clear unless i'm missing something.

2006-08-11 05:16:19 · answer #4 · answered by piquet 7 · 0 0

The IsNumeric() boolean function tests to be sure if the given fee is numeric. The Val() double function will return the numeric fee of any given fee. Val("123one") will return in simple terms '123'.

2016-10-01 22:55:18 · answer #5 · answered by ? 3 · 0 0

fedest.com, questions and answers