How do I move cursor to next textbox after hitting enter 
Author Message
 How do I move cursor to next textbox after hitting enter

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



Sun, 05 Jan 2003 03:00:00 GMT  
 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



Sun, 05 Jan 2003 03:00:00 GMT  
 How do I move cursor to next textbox after hitting enter
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then SendKeys vbTab: KeyAscii = 0
End Sub

--
Greg Siemon


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



Sun, 05 Jan 2003 03:00:00 GMT  
 How do I move cursor to next textbox after hitting enter
SendKeys "{Tab}" ,True
works for me.

Thanks Ken

David Adam


Quote:
> 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



> > 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



Sun, 05 Jan 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Hit ENTER to move to next control ?

2. Arrow key to move cursor to next textbox???

3. Arrow keys to move cursor to next textbox.

4. get rid of beep when hitting enter in textbox

5. Use enter key to move to next field

6. Make Enter key default move to next field?

7. Use enter key to move to next field

8. Using the ENTER key to move to the next field

9. Doing Error Checking before moving to next record

10. How to go to the next textbox with ENTER

11. Using ENTER instead of TAB to progress to next TextBox

12. How I can move cursor without using Enter button

 

 
Powered by phpBB® Forum Software