28 tabs

G

Guest

I have 28 tabs on a main form. On each tab are fields from the main table.
I want to use a combo box to go to the tab a user selects. I have tried
setfocus, goto control, etc but with no luck.

Can anyone provide me code to get from one tab to another based on a
selection from a combo box?

My tab control: TabCtl131
The first five names of my tabs: CESTab, GPTab, CSTab,WRRSTab, PCMSTab

Thanks in advance!
 
D

Douglas J. Steele

When you say that the names of the tabs are those five names, are you sure
that's the name of the pages, or is it just their captions?

If it's the name of the pages, you'd use Me.CESTab.SetFocus,
Me.GPTab.SetFocus etc. to select the specific page.

If it's just the captions of the pages, you'd use the names of the pages.
 
G

George Nicholson

To move to the tab with the PageIndex value of 0 (i.e., the left-most tab):
Me.TabCtl131.Value = 0
or
Me.TabCtl131 = 0

To move to a page that has a Name (not Caption) of CESTab:
Me.TabCtl131 = Me.Tabctl131.Pages("CESTab").PageIndex

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top