Tab Control - Changing Page Programatically

  • Thread starter Thread starter Keith
  • Start date Start date
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
 
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
 
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.
 
Back
Top