ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tab Index Not working? (https://www.excelbanter.com/excel-programming/389401-tab-index-not-working.html)

dan

Tab Index Not working?
 
The simplest things can make me crazy.

I have a simple user form. It has three text boxes, and one button (OK).

The text boxes have their TabIndexes set to 0, 1, and 2, and the button has
it's tab index set to 3.

As the user fills in the boxes, I want the focus to shift from box 1 to box
2 to box 3, and finally to the OK button.

I have set the TabIndex in the properties for each control at design time. I
have also added the statements to the Userform_activate() block:
textbox1.tabindex=0
etc.

And here's what happens.
User enters a value in the text box 1. Pressing tab takes the focus to:
TAB --- OK button
TAB --- text box 1
TAB --- text box 2
TAB --- OK button
TAB --- text box 1
TAB --- text box 2
TAB --- text box 3
TAB --- OK button
And then, pressing tab does what I want it to do:
text box 1 --- text box 2 --- text box 3 --- OK button.

So it's messed up the first time through, then it works right.

Can somebody give me an idea for what to look for here? Is there something
else I need to set in software?

Thanks in advance -
Dan

Mike Fogleman

Tab Index Not working?
 
Set the tab order for UserForm objects in the UserForm. In design mode,
right-click the UserForm surface and select Tab Order. All objects in the
UserForm will be listed. Arrange your tab order here. Any objects in this
list that has had its' Tab Stop property set to False, will be skipped over.

Mike F
"Dan" wrote in message
...
The simplest things can make me crazy.

I have a simple user form. It has three text boxes, and one button (OK).

The text boxes have their TabIndexes set to 0, 1, and 2, and the button
has
it's tab index set to 3.

As the user fills in the boxes, I want the focus to shift from box 1 to
box
2 to box 3, and finally to the OK button.

I have set the TabIndex in the properties for each control at design time.
I
have also added the statements to the Userform_activate() block:
textbox1.tabindex=0
etc.

And here's what happens.
User enters a value in the text box 1. Pressing tab takes the focus to:
TAB --- OK button
TAB --- text box 1
TAB --- text box 2
TAB --- OK button
TAB --- text box 1
TAB --- text box 2
TAB --- text box 3
TAB --- OK button
And then, pressing tab does what I want it to do:
text box 1 --- text box 2 --- text box 3 --- OK button.

So it's messed up the first time through, then it works right.

Can somebody give me an idea for what to look for here? Is there something
else I need to set in software?

Thanks in advance -
Dan





All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com