LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 470
Default Keydown Problem

I was given the following code for a combobox to have cursor advance to next
field if the ENTER button was pressed.

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

However, I am finding out that this does not work for textboxes, since you
have to type (keydown) in a textbox vs choosing from a list. I want the
cursor to advance to the next textbox, and have the backcolor turn yellow to
show current field. How does the PRIVATE Sub need to read since KEYDOWN is
not appropriate?

Private Sub Textbox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 13 Then textbox2.SetFocus
Textbox2.Backcolor = vbYellow
End Sub

Thanks,
Les
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
keydown, arrow keys problem Pointrider Excel Programming 4 March 24th 06 09:13 PM
Keydown and SelStart problem jase[_2_] Excel Programming 2 December 6th 05 01:46 PM
keydown event Peter T Excel Programming 0 April 18th 05 02:03 PM
keydown event K Dales[_2_] Excel Programming 0 April 18th 05 12:46 PM
keydown event jim c. Excel Programming 1 October 10th 03 03:16 AM


All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"