How do you convert text in the Keypress event to uppercase everytime you enter a character? I know how to do it in straight VB but not sure in VBA.
Thanks,
Blake
Printable View
How do you convert text in the Keypress event to uppercase everytime you enter a character? I know how to do it in straight VB but not sure in VBA.
Thanks,
Blake
UCase()
I just used the same method that you use in VB.
Text1.Text = Asc(Ucase(Chr(Keyascii)))
text1.text = ucase(text1.text)
pete
VB Code:
Private Sub Button1_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) End Sub
Dev,
Thanks for the code but that's what I always use for straight VB, however, I did retry it in VBA and it did work. Don't know why it didn't work the first time.
But thanks for the 2 cents.
Blessings,
Blake
Blake, most of VB6's basic functions, methods, and coding syntax is the same as VBA. ;)