?
Solved

Move to the next Text Box function

Posted on 2003-03-18
4
Medium Priority
?
153 Views
Last Modified: 2010-04-07
How can i make it that when you press enter you move to the next text box

I have tried

If keyascii = 13 then text1.SetFocus

and other things

any ideas?
0
Comment
Question by:Matthew Tandy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Jacamar
ID: 8162903
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text2.SetFocus
End Sub

This works for me
0
 
LVL 2

Expert Comment

by:Jacamar
ID: 8162930
just make sure it's in the keypress event
0
 
LVL 5

Accepted Solution

by:
JohnMcCann earned 420 total points
ID: 8162934
The alternative approach would be

Private Sub Text1_KeyPress(KeyAscii As Integer)
   If KeyAscii = vbKeyReturn Then SendKeys vbTab
End Sub


0
 
LVL 1

Expert Comment

by:Piter
ID: 8165395
Private Sub txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
 SendKeys "{TAB}"
End If
End Sub
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question