Try the following -

If Combo1.Text = "Product" Or Combo1.Text = "Size" Then
MaskedEit1.Enabled = False
End If

Do this under your combo_click event.

Edited 5 Years Ago by AndreRet: n/a

Yes, it works but it makes all items disable like the Cost as well. Here my codes:

If cboType.Text = "Product" Or cboType.Text = "Size" Then
mtxtCategory.Enabled = False
End If

Try the following -

If Combo1.Text = "Product" Or Combo1.Text = "Size" Then
MaskedEit1.Enabled = False
End If

Do this under your combo_click event.

Yes, it works but it makes all items disable like the Cost as well. Here my codes:

If cboType.Text = "Product" Or cboType.Text = "Size" Then
mtxtCategory.Enabled = False
End If

Then try and change the If to a select statement -

Private Sub cboType_Click()
Select Case cboType.Text

Case Is = "Cost"
mtxtCategory.Enabled = True

Case Is = "Product"
mtxtCategory.Enabled = False

End Select
End Sub

It's a pleasure, please mark this as solved, found at the bottom of this page, thanks.:)

Happy coding;)

By the way, do you know how to create a search box in Visual Basic? I want the search box based on streamreader. In proper terms, when I will input a text, it has to read on a text file in drice C. I know the streamreader code but don't know the code to do a search.

Yes you can, but it is off topic in this thread.:)

Please open a new thread, I'll answer from there, thanks.

This question has already been answered. Start a new discussion instead.