R
Robert Crandal
My userform contains one Textbox and one vertical Spinbutton control.
If someone presses either the spin-up or spin-down button, I want
the input focus to immediately change from the spinbutton to the
textbox control. I tried using the code below:
Private Sub SpinButton1_SpinDown()
UserForm1.TextBox1.SetFocus
End Sub
Private Sub SpinButton1_SpinUp()
UserForm1.TextBox1.SetFocus
End Sub
I thought the code above would be sufficient, but sometimes when
I press either spin button the focus does not change immediately
to the textbox control. It seems like the user has to press the same
spin button twice just to change the focus.
Does anybody know how to set this up so that if any spin button
is pressed the focus will immediately leave the spinbutton and go
somewhere else (i.e to the textbox control)
thank you
If someone presses either the spin-up or spin-down button, I want
the input focus to immediately change from the spinbutton to the
textbox control. I tried using the code below:
Private Sub SpinButton1_SpinDown()
UserForm1.TextBox1.SetFocus
End Sub
Private Sub SpinButton1_SpinUp()
UserForm1.TextBox1.SetFocus
End Sub
I thought the code above would be sufficient, but sometimes when
I press either spin button the focus does not change immediately
to the textbox control. It seems like the user has to press the same
spin button twice just to change the focus.
Does anybody know how to set this up so that if any spin button
is pressed the focus will immediately leave the spinbutton and go
somewhere else (i.e to the textbox control)
thank you