Solved

Getting active Tab

Posted on 2003-11-23
4
384 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 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

23 Experts available now in Live!

Get 1:1 Help Now