Switch between tabs using command button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have a TabControl with 2 subforms in each tab. A command button is
placed in the top subform of each tab. How do I go from one tab to another
upon click of the button? Thanks

Regards,
Sam
 
Sam Kuo said:
Hi, I have a TabControl with 2 subforms in each tab. A command button is
placed in the top subform of each tab. How do I go from one tab to another
upon click of the button? Thanks

Me.Parent.TabControlName.Value = n

where n is the index value of the desired page.
 
Hi, I have a TabControl with 2 subforms in each tab. A command button is
Me.Parent.TabControlName.Value = n

where n is the index value of the desired page.

Marvelous! Thanks, Rick
Is it possible to also set focus to top subform? Because currently focus is
always sent to the bottom subform.
 
Sam Kuo said:
Marvelous! Thanks, Rick
Is it possible to also set focus to top subform? Because currently focus is
always sent to the bottom subform.

The TabPage has its own TabOrder. Just make the top subform first in that
order.
 
Back
Top