Disable textbox

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

Guest

How to disable Textbox if is selected some value in Combo Box...

Example:
I have Combo1 with many values.
If select value "House" in this combo, Text1 must be disabled.

Thanks!
 
In the After Update event of the combo:

If Me.MyCombo = "House" Then
Me.TextBox.Enabled = False
End If
 
To ensure that the textbox gets re-enabled when something other than House
is selected, you probably want

If Me.MyCombo = "House" Then
Me.TextBox.Enabled = False
Else
Me.TextBox.Enabled = True
End If

although I prefer

Me.TextBox.Enabled = (Me.MyCombo <> "House")
 
Back
Top