prevent the user to open the list of the combo-box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a combo box in a sub form.
I would like to restrict the use in a way that in some cases, depends on a
value of a field in the main form, the list of the combp box will not open.

Currently, on the event mouseDown, I open another form with an alert that it
is not possible to change the value. The problem is that the window with the
list of the combo-box is still opened.

How can I avoid this from happening?

Thanks a lot,
Liat
 
Liat,

Would it suit your purpose to use code to toggle the Enabled and Locked
properties of the combobox, depending on the value of the main form
control, so the combobox is simply inaccessible in the circumstances you
prescribe?
 
I think I tried that.
Could you please tell me the code for that?

Thanks,
Liat

"Steve Schapel" כתב:
 
Liat,

Well, it's not easy without many hints from you as to what you've got
and what you're doing. But here's an example which you can adapt to
your situation...

Private Sub YourMainFormControl_AfterUpdate()
With Me.YourSubform.Form!YourCombo
.Enabled = (Me.YourMainFormControl = "fred")
.Locked = (Me.YourMainFormControl <> "fred")
End With
End Sub
 
Back
Top