I have a problem with the tab order on a userform that I cannot understand.
My form has the following controls of interest:
ComboBox1: Tab order = 0
TextBox1: Tab order = 1
TextBox2: Tab order = 2
CommandButton1: Tab order = 3
CommandButton2: Tab order = 4
Frame1: Tab order = 4
All have their .tabstop = true
If I run the form and just tab-tab-tab... the controls follow the tab order properly.
In TextBox2_Change
I validate the information from ComboBox1, TextBox1 and TextBox2.
If valid I set CommandButton1.Enabled = False
My expectation is that after entering information into TextBox2 and pressing tab that CommandButton2 will get the focus
However Frame1 gets the focus.
I tried to explicitly set CommandButton2.setfocus in TextBox2_change. However that results in Run-time error '2147467259 (80004005)': Unspecified error.
I'm very confused, as this seems like a straight-forward thing.
My form has the following controls of interest:
ComboBox1: Tab order = 0
TextBox1: Tab order = 1
TextBox2: Tab order = 2
CommandButton1: Tab order = 3
CommandButton2: Tab order = 4
Frame1: Tab order = 4
All have their .tabstop = true
If I run the form and just tab-tab-tab... the controls follow the tab order properly.
In TextBox2_Change
I validate the information from ComboBox1, TextBox1 and TextBox2.
If valid I set CommandButton1.Enabled = False
My expectation is that after entering information into TextBox2 and pressing tab that CommandButton2 will get the focus
However Frame1 gets the focus.
I tried to explicitly set CommandButton2.setfocus in TextBox2_change. However that results in Run-time error '2147467259 (80004005)': Unspecified error.
I'm very confused, as this seems like a straight-forward thing.