Advancing Cursor

G

Guest

I have a userform with a combobox and two text boxes. Currently, I can only
advance the cursor from one box to another with the right tab key. How can I
change it so that the ENTER key advances the cursor to the next box?

Thanks,
Les
 
G

Guest

Use the Keydown event of TextBox1 as

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then TextBox2.SetFocus
End Sub

Hope this helps!!
 
J

Jim Cone

In the properties window of the VBE, set the EnterKeyBehavior to False
for each text box.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"WLMPilot"
wrote in message
I have a userform with a combobox and two text boxes. Currently, I can only
advance the cursor from one box to another with the right tab key. How can I
change it so that the ENTER key advances the cursor to the next box?
Thanks,
Les
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top