I have a user form with several text boxes and command buttons. I have the tab order setup like this:
txtBox1 - tab 0
cmdButton1 - tab 1
txtBox4 - tab 2
cmdButton2 - tab 5
When users enter text in txtBox1 they can hit ENTER<enter> twice which activates cmdButton1, this is desired behavior.
When certain text is entered in txtBox1, code changes focus to txtBox4 where the user enters additional text, this is desired behavior. However when they hit <enter> ENTER in txtBox4 the focus then shifts to cmdButton2, and I need it to activate cmdButton1 instead.
I have tried several ways like using the txtBox4_exit to call cmdButton1 and/or txtBox1.SetFocus. Setting focus has proven to be not very intuitive. It seems when focus switches between command buttons and text boxes things just go wacky. Throw in a few MsgBoxes and it just gets more weird.</enter></enter>
txtBox1 - tab 0
cmdButton1 - tab 1
txtBox4 - tab 2
cmdButton2 - tab 5
When users enter text in txtBox1 they can hit ENTER<enter> twice which activates cmdButton1, this is desired behavior.
When certain text is entered in txtBox1, code changes focus to txtBox4 where the user enters additional text, this is desired behavior. However when they hit <enter> ENTER in txtBox4 the focus then shifts to cmdButton2, and I need it to activate cmdButton1 instead.
I have tried several ways like using the txtBox4_exit to call cmdButton1 and/or txtBox1.SetFocus. Setting focus has proven to be not very intuitive. It seems when focus switches between command buttons and text boxes things just go wacky. Throw in a few MsgBoxes and it just gets more weird.</enter></enter>