I am posting this here because it relates to converting all letters to uppercase. (Saves double posting)
In this example if the character is a-z it converts it to uppercase.
The line KeyAscii = Asc(UCase(Chr(KeyAscii))) will accept numbers without modifying them.
Code:
Private Sub text1_KeyPress(KeyAscii As Integer)
MsgBox KeyAscii
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = Asc(UCase(Chr(KeyAscii)))
Else
KeyAscii = 0
End If
End Sub
this works for any function that has the ascii value passed as a parameter.
This code is part of a thread I started a while back, Hack came up with the solution. Credit goes to him.