Solved

Activate only 1 combo box

Posted on 2000-03-13
5
176 Views
Last Modified: 2010-05-02
Hello,

     In Excel 97, I have a form that has 3 comboboxes.  I'd like the user to be able to choose only ONE of the combo boxes.  (I have 3 combo boxes for 3 different categories, and only 1 of those can be processed).  

     For example, if the user chose a selection in combobox 1, but then also tried to select something in combobox 2, combobox 1 would be DESELECTED, and the new choise (combobox2) is the new selection.

     Does anyone have the work around for this?  
   Thank you!!!
0
Comment
Question by:mlouie23
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Marine
ID: 2614451
I never did VBA but here is a thought. Create a Control Array and depnding on the ComboBox selected disable the other 2.
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 25 total points
ID: 2614586
The first item of the combobox reads something like "Select from list."  Then, with this code, if a selection is made in any of the combos, the others will reset to index 0 (top of list).

Private Sub Combo1_Click()
    If Combo1.ListIndex <> 0 Then
        'Reset all other combos
        Combo2.ListIndex = 0
        Combo3.ListIndex = 0
    End If
End Sub

Private Sub Combo2_Click()
    If Combo2.ListIndex <> 0 Then
        'Reset all other combos
        Combo1.ListIndex = 0
        Combo3.ListIndex = 0
    End If
End Sub

Private Sub Combo3_Click()
    If Combo3.ListIndex <> 0 Then
        'Reset all other combos
        Combo1.ListIndex = 0
        Combo2.ListIndex = 0
    End If
End Sub
0
 

Author Comment

by:mlouie23
ID: 2614700
Adjusted points from 15 to 25
0
 

Author Comment

by:mlouie23
ID: 2614701
Erik37,

    Great...thanks so much for helping me with these combo boxes.  I really appreciate it.  I want to award you more points for such a great solution, but bumping it up to 25 is all I could afford right now.  

Thank you!
0
 
LVL 32

Expert Comment

by:Erick37
ID: 2614719
Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

937 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

4 Experts available now in Live!

Get 1:1 Help Now