Solved

Getting active Tab

Posted on 2003-11-23
4
385 Views
Last Modified: 2012-06-27
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 !
0
Comment
Question by:rouxjean
  • 2
  • 2
4 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 9806654
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
 

Author Comment

by:rouxjean
ID: 9806767
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
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 9806792
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
 

Author Comment

by:rouxjean
ID: 9807001
Many thanks for your help :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now