Solved

Changing a tab index when a control has focus

Posted on 2008-10-02
2
532 Views
Last Modified: 2013-11-28
I'll keep this basic. In Microsoft Access VBA, I am designing a form with 3 options, let's call them A, B, and C, that are grouped together, using the radio button control. So, I've got 3 radio buttons.

To the right of my radio buttons, I have a tab control with 3 tabs, each corresponding to an option. When I select option A, I want tab A to be on top. When I select Option B, I would like Tab B to come to the top, and so forth with option and tab C. Also, when one option is selected, the other tabs should be unavailable.

for example:

Private Sub optA_GotFocus()
     Me.tabA.Enabled = True
     Me.tabB.Enabled = False
     Me.tabC.Enabled = False
End Sub

I'm running in circles. I don't know why, with all the resources I have, I can't figure this out. Someone make a suggestion please.
0
Comment
Question by:atsukoarai86
2 Comments
 
LVL 2

Accepted Solution

by:
rene119 earned 50 total points
ID: 22628189
In the on click event of your frame object that holds your options add this code.

Rene
Private Sub YourFrameName_Click()

    If Me.YourFrameName.Value = A Then

        Me.TabNameA.Enabled = True

        Me.TabNameA.SetFocus

        Me.TabNameB.Enabled = False

        Me.TabNameC.Enabled = False

    ElseIf Me.YourFrameName.Value = B Then

        Me.TabNameB.Enabled = True

        Me.TabNameB.SetFocus

        Me.TabNameA.Enabled = False

        Me.TabNameC.Enabled = False

    ElseIf Me.YourFrameName.Value = C

        Me.TabNameC.Enabled = True

        Me.TabNameC.SetFocus

        Me.TabNameA.Enabled = False

        Me.TabNameB.Enabled = False

    End If

End Sub

Open in new window

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

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