Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Changing a tab index when a control has focus

Posted on 2008-10-02
2
Medium Priority
?
541 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

916 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