Change tab control page programmatically

G

Guest

Hi,
Can anyone show me the correct syntax for changing a tab control to a
specific tab in response to a button's on_click event? The button is on a
separate form from the form that contains the tab control.

Many thanx,

Ripper T
 
S

Sandra Daigle

You set the value of the tabcontrol to be the index of the page you want.
Note that the pageindex starts with 0 so the following will make the 2nd
page the current one:

me.MyTabCtl=1

Also, consider using the the name of the page itself to indirectly specify
the page index. Since page names rarely change but the order might if you
add something (or haven't finished designing the page). The following would
make the page named "pgOrders" the current page (regardless of the actual
index of pgOrders)

Me.MyTabCtl = me.MyTabCtl.Pages("pgOrders").PageIndex
 

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