Tab Control - Changing Page Programatically

K

Keith

Hi

Is it possible to change the tap (or page) of a tab control programatically.

In my DB I want to says "if check box A is checked, show Tab 6 when record
opens".

Thanks
 
S

Sandra Daigle

You just 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
 
R

Rick Brandt

Keith said:
Hi

Is it possible to change the tap (or page) of a tab control programatically.

In my DB I want to says "if check box A is checked, show Tab 6 when record
opens".

Either set the TabControl's Value property to the index number of the desired page or
set focus to a control that resides on the desired page.
 

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