Solved

Changing a tab index when a control has focus

Posted on 2008-10-02
2
536 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

752 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