Page/Tab forward per button in Tab control?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a button on a tab control's first tab that I use to do some things
that I need so that subforms on the other tabs display correctly.
I am wondering if it's possible to also have that button go to the next tab,
in other words, when I press it, I want it to do what it's doing, and after
that, switch the view to the second tab.
 
Just put code along the lines of:

Me.Page2.SetFocus

to switch to the second page of the tab control.

Alternatively, you can use:

Me.NameOfTabControl.Value = <number of page>

Note that the numbering starts at 0: the 2nd page would be 1.
 
Two ways:
Using the name of the page
Me.TabCtl0.Pages("page2").SetFocus
Useing the position of the page (The first page is 0)
Me.TabCtl0.Pages(0).SetFocus
 
You can do that at least two different ways:
1) Finish your code with a SetFocus to a control on the next page.
2) Finish your code by setting the TabCtrl index to the page you want.
it is a zero based index so Me.TabCtrl = 1 will go to the second tab.
...using your tab control name of course.
 
Thank you, it works nicely.

ruralguy via AccessMonster.com said:
You can do that at least two different ways:
1) Finish your code with a SetFocus to a control on the next page.
2) Finish your code by setting the TabCtrl index to the page you want.
it is a zero based index so Me.TabCtrl = 1 will go to the second tab.
...using your tab control name of course.


--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
You're welcome from all three of us. Boy we sure jumped on that one didn't
we? ;)
Thank you, it works nicely.
You can do that at least two different ways:
1) Finish your code with a SetFocus to a control on the next page.
[quoted text clipped - 9 lines]
 
Back
Top