PC Review


Reply
Thread Tools Rate Thread

Deleting Comboboxes

 
 
aqualibra
Guest
Posts: n/a
 
      3rd Oct 2008
I have two sets of comboboxes.
I set has 5 comboboxes and the other has 7 comboboxes.

In the second set, first five comboboxes are the same as set 1.

If I choose set1, all the comboboxes of set 1 are seen and if I choose set
2, all the comboboxes of set 2 are seen.

Is there a way to code such that depending on what set I choose their
respective comboboxes appear. In other words, I want the two extra comboboxes
to appear and disappear depending on what set is chosen.

Thanks you
 
Reply With Quote
 
 
 
 
FunkySquid
Guest
Posts: n/a
 
      3rd Oct 2008
If you create 7 comboboxes and call then ComboBox1-7. Then create 2
OptionButtons and call them optSet1 and optSet2 then paste the
following code into the form.

Private Sub optSet1_Click()
If optSet1.Value = True Then
Call ChangeComboSet1Visible(True)
Call ChangeComboSet2Visible(False)
End If
End Sub

Private Sub optSet2_Click()
If optSet2.Value = True Then
Call ChangeComboSet1Visible(True)
Call ChangeComboSet2Visible(True)
End If
End Sub

Function ChangeComboSet1Visible(boolVisible As Boolean)
Me.ComboBox1.Visible = boolVisible
Me.ComboBox2.Visible = boolVisible
Me.ComboBox3.Visible = boolVisible
Me.ComboBox4.Visible = boolVisible
Me.ComboBox5.Visible = boolVisible
End Function

Function ChangeComboSet2Visible(boolVisible As Boolean)
Me.ComboBox6.Visible = boolVisible
Me.ComboBox7.Visible = boolVisible
End Function

Private Sub UserForm_Activate()
Call ChangeComboSet1Visible(False)
Call ChangeComboSet2Visible(False)
End Sub

Hope this helps.


On 3 Oct, 15:00, aqualibra <aquali...@discussions.microsoft.com>
wrote:
> I have two sets of comboboxes.
> I set has 5 comboboxes and the other has 7 comboboxes.
>
> In the second set, first five comboboxes are the same as set 1.
>
> If *I choose set1, all the comboboxes of set 1 are seen and if I chooseset
> 2, all the comboboxes of set 2 are seen.
>
> Is there a way to code such that depending on what set I choose their
> respective comboboxes appear. In other words, I want the two extra comboboxes
> to appear and disappear depending on what set is chosen.
>
> Thanks you


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
comboboxes aqualibra Microsoft Excel Programming 2 17th Sep 2009 08:05 PM
comboboxes =?Utf-8?B?WmFhaGly?= Microsoft Excel Programming 1 27th Oct 2006 02:43 PM
ComboBoxes =?Utf-8?B?QmlsbA==?= Microsoft VB .NET 0 20th Feb 2004 03:56 PM
ComboBoxes =?Utf-8?B?Smlt?= Microsoft VB .NET 1 16th Feb 2004 03:19 PM
Comboboxes Steven Smith Microsoft VB .NET 3 19th Nov 2003 10:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:05 PM.