Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to determine which tab was clicked 1

Status
Not open for further replies.

colezpapa3

Programmer
Dec 8, 2007
73
US
I have a tabbed form...there are 5 tabs that the user can select. Is there a way to determine which tab was clicked.
I know there is a pageindex property...but it is not visible in intellisense.
 
Look @ the OnChange Event
Code:
Private Sub TabCtl_Change()
Debug.Print Me.Sforms.Value
End Sub
 
G'day fella,

I seem to recall you can use something like

yourresult=me!tbYourTabControl.pageindex.name

and/or

yourresult=me!tbYourTabControl.pageindex.caption

Hope this helps,

JB
 
pageindex is used to set the pageindex

to get the name or caption when the user clicks use this code

Code:
Private Sub TabCtl_Change()
Debug.Print Me.Sforms.Value
Debug.Print  Me.Sforms.Pages(Me.Sforms).Name,
Debug.Print Me.Sforms.Pages(Me.Sforms).Caption
End Sub
 
That's the one Mr Pwise. I remember years ago it took me ages to get the syntax right. The help file is a little misleading on this so hopefully others will scroll past my bum steer to your correct info!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top