Tab Order in UserForm of Controls Across Multiple Frames

poopiebear

New Member
Joined
Nov 19, 2010
Messages
41
Hello. I have a userform with 3 frames. Each of the frames have controls within them. I want to be able to tab not only within a single frame, but also across different frames. Is this possible.

For example:

Frame1 - ComboBox1, Textbox1, Textbox2, Textbox3, Textbox4
Frame2 - OptionButton1, OptionButton2
Frame3 - Textbox5, Textbox6

Tab Order:

Frame1.ComboBox1 > Frame2.OptionButton1 > Frame2.OptionButton2 > Frame1.TextBox1 > Frame1.TextBox2 > Frame3.Textbox5 > Frame1.TextBox3 > Frame1.TextBox4 > Frame3.Textbox6

Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I think I figured it out. First, I set the tab order from the Properties in each Frame. When I reach the control that I want to jump from one frame to another, I use this code:

Code:
Private Sub TextBox2_KeyDown(ByVal KeyCode As msforms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 Then
TextBox5.SetFocus
End If
End Sub
 
Private Sub TextBox5_KeyDown(ByVal KeyCode As msforms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 9 Then
TextBox3.SetFocus
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,259
Members
452,901
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top