
How do I move cursor to next textbox after hitting enter
There are a couple ways to do this....
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii =13 then
KeyAscii = 0 'Suppress beep
TheNextTextBox.SetFocus
End If
End Sub
or
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii =13 then
KeyAscii = 0 'Suppress beep
SendKeys "{Tab}" ,True 'Send a tab key to move the cursor to the
next control in the tab order.
End If
End Sub
Quote:
> I need to move to the next textbox after a user hits enter. Is there a
way
> to do this?
> Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
> Select Case KeyCode
> Case vbKeyReturn
> rstreturns!Date = returns.Text2.Text & vbNullString
> KeyCode = 9 ???
> End Select
> End Sub
> Thanks in advance for any help
> David Adam