Solved

Changing a tab index when a control has focus

Posted on 2008-10-02
2
537 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

626 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