Solved

Getting active Tab

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

680 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