Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with ComboBox in VBA
I have form with 2 ComboBoxes (Market and Phase), 1 Frame with 3
OptionButtons (Today, Tomorrow, Both). I am trying to set up a process where all the controls on the form are disabled except for Market. When a value is selected for Market, Phase becomes enabled. When a value is selected for Phase, the frame and all the OptionButtons becomes enabled. Now if I go into the Phase ComboBox and manually delete the value in it, I want the frame and all the OptionButtons to become disabled. How do I do this? So far all I have is this: Private Sub cmbPhase_Change() If Not IsNull(Me.cmbPhase.Text) Then Me.frmReport.Enabled = True Me.optBoth.Enabled = True Me.optToday.Enabled = True Me.optTomorrow.Enabled = True ElseIf IsNull(Me.cmbMarket.Text) Then Me.frmReport.Enabled = False Me.optBoth.Enabled = False Me.optToday.Enabled = False Me.optTomorrow.Enabled = False End If End Sub Any help will be greatly appreciated. Thanks Ayo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help with ComboBox in VBA
Would hiding and unhiding the controls work just as well?
In the form initialize event, hide the phase combobox and the frame. When the Market combobox is clicked, use the click event code to unhide the phase combobox. When the phase combox is clicked, use the click event code to unhide the frame. "Ayo" wrote in message ... I have form with 2 ComboBoxes (Market and Phase), 1 Frame with 3 OptionButtons (Today, Tomorrow, Both). I am trying to set up a process where all the controls on the form are disabled except for Market. When a value is selected for Market, Phase becomes enabled. When a value is selected for Phase, the frame and all the OptionButtons becomes enabled. Now if I go into the Phase ComboBox and manually delete the value in it, I want the frame and all the OptionButtons to become disabled. How do I do this? So far all I have is this: Private Sub cmbPhase_Change() If Not IsNull(Me.cmbPhase.Text) Then Me.frmReport.Enabled = True Me.optBoth.Enabled = True Me.optToday.Enabled = True Me.optTomorrow.Enabled = True ElseIf IsNull(Me.cmbMarket.Text) Then Me.frmReport.Enabled = False Me.optBoth.Enabled = False Me.optToday.Enabled = False Me.optTomorrow.Enabled = False End If End Sub Any help will be greatly appreciated. Thanks Ayo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
fill combobox depending on selection from another combobox | Excel Discussion (Misc queries) | |||
Combobox items determined by the selection in another combobox | Excel Programming | |||
Combobox options based on the input of another combobox | Excel Programming | |||
ComboBox list reliant on the entry from a different ComboBox | Excel Programming | |||
How Do I Load A ComboBox RowSource From The Results Of Another ComboBox | Excel Programming |