?
Solved

Changing a tab index when a control has focus

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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

719 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