If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
ucase on change
I have a textbox that the user wants to have all caps while he types into the
textbox. The following code is in the onchange event for the textbox. txtNameKey.Text = UCase(txtNameKey.Text) txtNameKey.SelStart = Len(txtNameKey) + 1 This takes the textbox back to the first letter and overwrites it. I want it to type the second letter and then third etc. Thanks. |
#2
|
|||
|
|||
ucase on change
"seeker" wrote in message
... I have a textbox that the user wants to have all caps while he types into the textbox. The following code is in the onchange event for the textbox. txtNameKey.Text = UCase(txtNameKey.Text) txtNameKey.SelStart = Len(txtNameKey) + 1 This takes the textbox back to the first letter and overwrites it. I want it to type the second letter and then third etc. Thanks. I don't think I'd use the Change event for this. How about using the control's KeyPress event instead, to translate each keystroke as it is typed: '------ start of code ------ Private Sub txtNameKey_KeyPress(KeyAscii As Integer) KeyAscii = Asc(UCase(Chr(KeyAscii))) End Sub '------ end of code ------ -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#3
|
|||
|
|||
ucase on change
You could try this in the KeyPress event of the Text box :-
KeyAscii = Asc(UCase(Chr(KeyAscii))) HTH Peter Hibbs. On Sun, 1 Nov 2009 10:30:01 -0800, seeker wrote: I have a textbox that the user wants to have all caps while he types into the textbox. The following code is in the onchange event for the textbox. txtNameKey.Text = UCase(txtNameKey.Text) txtNameKey.SelStart = Len(txtNameKey) + 1 This takes the textbox back to the first letter and overwrites it. I want it to type the second letter and then third etc. Thanks. |
Thread Tools | |
Display Modes | |
|
|