I have a text box i am using as a search text box. I have a search button which I want to only become enabled when there is text in the search text box. I have tried the following in the textbox on change event but to no avail.
if searchBox.Value = "" then
okBtn.enabled = false
else
okBtn.enabled = true
end if
Also I'm after making it so that if the user doesn't click on the button then they can just press the enter key when in the textbox and it will do the search.
I tried something in the keydown event for the textbox involving vbenterkey (i think) but that didn't work either.
Any help would be greatly appreciated!
if searchBox.Value = "" then
okBtn.enabled = false
else
okBtn.enabled = true
end if
Also I'm after making it so that if the user doesn't click on the button then they can just press the enter key when in the textbox and it will do the search.
I tried something in the keydown event for the textbox involving vbenterkey (i think) but that didn't work either.
Any help would be greatly appreciated!