View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default 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