S
SS
Hello all,
I have three textboxes that I created by clicking on the textbox icon in the
control toolbox. For each of these textboxes I have the following code:
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 9 Then Me.TextBox2.Activate
End Sub
Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 9 Then Me.TextBox3.Activate
End Sub
Private Sub TextBox3_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 9 Then Me.TextBox1.Activate
End Sub
When I click on the first textbox and hit enter, the code does what I want
it to do i.e. the focus moves the focus from TextBox1 to TextBox2. But when
I hit tab again, instead of the focus moving from TextBox2 to TextBox3, a
tab character is entered in TextBox2. If I click outside any of the boxes,
then click in TextBox2 and hit tab, it works fine again i.e. the focus moves
from TextBox2 to TextBox3. Why doest my focus move from TextBox2 to
TextBox3 without going through the deselcting and selecting operation with
the mouse? How can I fix it?
Please help.
SS
I have three textboxes that I created by clicking on the textbox icon in the
control toolbox. For each of these textboxes I have the following code:
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 9 Then Me.TextBox2.Activate
End Sub
Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 9 Then Me.TextBox3.Activate
End Sub
Private Sub TextBox3_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If KeyCode = 9 Then Me.TextBox1.Activate
End Sub
When I click on the first textbox and hit enter, the code does what I want
it to do i.e. the focus moves the focus from TextBox1 to TextBox2. But when
I hit tab again, instead of the focus moving from TextBox2 to TextBox3, a
tab character is entered in TextBox2. If I click outside any of the boxes,
then click in TextBox2 and hit tab, it works fine again i.e. the focus moves
from TextBox2 to TextBox3. Why doest my focus move from TextBox2 to
TextBox3 without going through the deselcting and selecting operation with
the mouse? How can I fix it?
Please help.
SS