how can you move to another text box just by pressing ENTER instead of the TAB key
Printable View
how can you move to another text box just by pressing ENTER instead of the TAB key
Make the text box multiline
Then in the _KeyPress event add this code
private text1_keypress(keycode as integer...)
if keycode = vbkeyreturn then
keycode = 0
SendKeys vbkeytab ' or the correct syntax
end if
end sub
private text1_keyup(keycode as integer...)
if keycode = vbkeyreturn then
keycode = 0
end if
end sub
However this works only for singleline text boxes.
RK
Hi,
Use the following code:
private Sub Text1_KeyDown(KeyCode as Integer, Shift as Integer)
if KeyCode = vbKeyReturn then
text2.setfocus
end if
End Sub
I hope this works!!!
regards,
Santulan
Santulan