I want to catch the page index on a Tab control when the tab is selected. Right now I can only trap it on the click event for the page which fires when you click on the page itself, not the tab of the page. Any help will be appreciated.
The name of the tab control is TabCtl0. Click on the tab bar where no tab is placed and you can get at these events. Here is an example of some things done when the tab changes.
Private Sub TabCtl0_Change()
Dim tbc As control, pge As Page, oldPge As Page
' Return reference to tab control.
Set tbc = Me!TabCtl0
' Return reference to currently selected page.
Set pge = tbc.Pages(tbc.Value)
' Enumerate controls on currently selected page.
''--Debug.Print "Page Name = "; pge.Name
''--Debug.Print "Last Page Name = "; glbLastPage
If (pge.Name = "Shop Order List" Then
glbLastPage = pge.Name
Exit Sub
Else
'--- Always go to the Equipment form to get the equipment Number
'--- when coming from the shop order
If glbLastPage = "tpShopOrder" Then
Forms!MotorDataEntry!tabsubformEquipment.SetFocus
End If
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.