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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab control, how set active tab when form opened ? 1

Status
Not open for further replies.

gazolba

Programmer
Dec 4, 2001
167
US
I have a tabbed control, when I open the form that it is in, how do I control which tab is the active tab?
Different tabs need to be active under different circumstances.
 
Hi!

I usually set focus to a control on the tab I wish to "be active".

Else, you could use the pages collection of the tab object:

[tt]Select Case <somecondition>
case 1
me!mytab.pages(0).setfocus
case 2
me!mytab.pages(1).setfocus
'...
End Select[/tt]

Or use the page name:

[tt]Select Case <somecondition>
case 1
me!mytab.pages("FirstTab").setfocus
case 2
me!mytab.pages("SecondTab").setfocus
'...
End Select[/tt]

Roy-Vidar
 
Hi

You couild just set teh value of the tab control itself eg

MyTabControl = 1

this will make tab 1 (they are numbered from zero) the active tab

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top