Getting active Tab

Hi !

I have a standrad tab control in one Access form. How do  i get the index, or name of the selected (active) tab ???

Thanks !
rouxjeanAsked:
Who is Participating?
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Just us it directly.  For example:

Private Sub Command1_Click()
    TabCtl0.Value = 2 ' Select the third tab
End Sub

This would cause the third tab to be selected when the Command1 button is clicked.

Regards,

Idle_Mind
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
From the Access Help File:

"The Value property of a tab control contains the index number of the current Page object. There is one Page object for each tab in a tab control. The first Page object always has an index number of 0, the second has an index number of 1, and so on."

If you wanted to know everytime tabs are changed, put code in the Change event for the Tab Control.

Private Sub TabCtl0_Change()
    MsgBox "Changed to Tab " & TabCtl0.Value
End Sub

Regards,

Idle_Mind
0
 
rouxjeanAuthor Commented:
Hi !

Thanks for your reply...I tried the damn thing and it didn't work and now it's ok...Oh well !
Can you also answer this easy question : how do i select programmatically a tab using this value ?

Thx
0
 
rouxjeanAuthor Commented:
Many thanks for your help :)
0
All Courses

From novice to tech pro — start learning today.