une


I have a userform with 5 text boxes and a command button on it. When the macro that shows the userform is executed the cursor is sitting in the first text box. However when the user presses TAB the cursor does not go to the next text box on the userform, it jumps to the third one. After fillling in text box 4 and pressing TAB the cursor does not go to text box 5, it highlights the command button. How do I control how tabbing moves the cursor between text boxes

At first the text box names did not match their order of appearance on the userform. The first text box was TextBox1, the next one was TextBox5, the third TextBox2 etc.So I renamed them all to be in a sequential order. This did not change the situation.




Re: Tabbing between text boxes

Peter Mo.


Hi

The controls on a UserForm have a property TabIndex that controls the sequence when the user tabs.

Regards

Peter Mo.






Re: Tabbing between text boxes

Andy Pope

To add to Peter's answer.

In design mode you can right click on the userform and select Tab Order.
This displays your controls in an ordered listbox. Changing the order within the listbox will change the tab index value of the controls.