Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using tab on a form

Status
Not open for further replies.

alexanderd

Technical User
Aug 31, 2003
20
GB
i have an excel 2002 form in which textbox10 requires an answer of Yes or No.
if vbNo i would like to jump to textbox20 which i have set the focus for.
what i want to do is TAB only once and be in textbox20 is this possible, if possible can anyone suggest a method of doing this using VBA
 
You seem to be asking two separate things.

1. a) a movement based on logic - if result of textbox10 = vbNo...move the focus from textbox10 to textbox20. (ASIDE: sigh, default names.....)

b) if textbox10 is a TEXTBOX, are you requiring the user type in "yes" or "no"? This seems a waste of a textbox. If you are requiring a yes/no you should probably be using Option buttons.

Movement based on logic does not require a Tab.

2. a movement based on a Tab. Please explain better.

The user has a Yes in textbox10 - they press Tab...do you still want it to go to textbox20? What exactly does the Tab have to do with the logic based on the value of textbox10.

In any case, yes, you can change the TabIndex programatically - in other words, based on some logic you can change where the next tab goes to. Just be aware that the tab order of eveything else gets adjusted as well.

But I am not quite following what you are doing.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top