hi
i am trying to accepte text in text box only numbers and capital alphabets in keypress event
below code is not converting lower case to upper case
Private Sub Tbx_AcctCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Tbx_AcctCode.KeyPress
Dim KeyAscii As Short
KeyAscii = Asc(e.KeyChar)
If KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 48 And KeyAscii <= 57 Or _
KeyAscii >= 97 And KeyAscii <= 122 Or _
KeyAscii = 13 Or _
KeyAscii = 8 Then
Else
e.Handled = True
End If
' change lower case to upper case - NOT WORKING
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub