DropDown rephrased

G

Guest

Hi
I would like to prevent the list showing in a combobox if a condition is not
met in another control elsewhere on a userform.

It is not possible to use the other control's Exit event and Cancel = True
and I cannot disable or lock the combobox as it's DropButtonClick event would
not be fired.

If
ComboBox1.DropDown can reveal the list then:
ComboBox1.DropDown = False has no effect.

What should the syntax be to prevent DropDown? Appreciate any ideas.


T.I.A.

Geoff
 
G

Guest

Hi Toppers
Thanks for the reply, I have found a way. Right or wrong it seems to work.

In further testing I found that if I returned the focus to the 'conditional
' control from the cbobox in an cbobox_enter event like so, it prevents the
list showing.

Private Sub cbo1_Enter()

If opt1.Value = False And opt2.Value = False Then
fraop1opt2.SetFocus
Exit Sub
End If
'rest of code

End Sub

Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top