Solved

Activate only 1 combo box

Posted on 2000-03-13
5
173 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
Comment Utility
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
Comment Utility
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
Comment Utility
Adjusted points from 15 to 25
0
 

Author Comment

by:mlouie23
Comment Utility
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
Comment Utility
Thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

771 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

12 Experts available now in Live!

Get 1:1 Help Now