Brianna Cates
Brianna Cates

Reputation: 347

Enable Textbox if any selection is made in a combobox in Access

Hey I am trying to get a textbox to enable based on if someone selects any value in a combobox it does not have to be a specific one just any value. This is the code I have so far and I am getting a Type Mismatch error, but my field type is short text.

Private Sub cmbOwner2_Click()
If Me.cmbOwner2.Value Then
Me.txtOwner2.Enabled = True
Else
Me.txtOwner2.Enabled = False
End If
End Sub

Thanks in advance! Also, I am using VBA if thats not obvious lol

Upvotes: 0

Views: 1676

Answers (1)

psychicebola
psychicebola

Reputation: 949

try this

Private Sub cmbOwner2_Click()
If Me.cmbOwner2.Value <> "" Then
Me.txtOwner2.Enabled = True
Else
Me.txtOwner2.Enabled = False
End If
End Sub

Upvotes: 1

Related Questions