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