Click to See Complete Forum and Search --> : Press ENTER instead of TAB to go to next text Box


December 8th, 1999, 04:45 AM
how can you move to another text box just by pressing ENTER instead of the TAB key

Ravi Kiran
December 8th, 1999, 05:05 AM
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

santulan
December 8th, 1999, 08:38 AM
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