Solved

Getting active Tab

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

815 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

9 Experts available now in Live!

Get 1:1 Help Now