Mdaox
Mdaox

Reputation: 81

Change or override tab order in excel userform

I have a user form that has a tab order as follows,

txtCode
txtName
cboGrade
txtPhone
txtDormitory
cboPhase
cboCourse
cboStatus
txtGrad
txtCsd
txtSsn
txtComments
cboGender
txtADD

However I have a command button cmdContinue that after I hit that button I want it to go straight to "cboStatus", is there any way to add that in my code

i.e

Private Sub cmdContinue_click()

insert my code here

cboStatus.select
end sub

Is there anything that will work? Thanks

Upvotes: 1

Views: 2227

Answers (1)

adhy wijaya
adhy wijaya

Reputation: 509

You can order by tab index property (Ex. if the TabIndex property value of cmdContinue is 10, you need to change the TabIndex property value of cboStatus to 11).

Or

you can use this code as well:

Private Sub cmdContinue_click()

    'insert your code here

    cboStatus.SetFocus

End Sub

Hope this help.

Upvotes: 2

Related Questions