Howdy! I've spent several hours working on this, but haven't been able to land the solution. I hope your expertise can point me in the right direction!
I have a continuous form that has an optional search that uses a combobox. My goal is for the combobox to remain hidden until ANY text is entered into the textbox.
The best I can do right now is using the textbox's AfterUpdate event to trigger the if/then code that displays the combobox. I've got this working, but it's frustrating, because I have to "update" the textbox by either tabbing out or hitting "enter". I really want the combobox to appear as soon as I begin typing text into the textbox.
To complicate it a step further, by design I want the combobox to disappear when the textbox is cleared.
Here's the current state of my code. Note that "OmniSearch" refers to the textbox, and "lst_Leaders" is the combobox.
Private Sub Omnisearch_AfterUpdate()
Call Form_Current
End Sub
Private Sub Form_Current
If IsNull(Me.OmniSearch) Then
Me.lst_Leaders.Visible = False
Else
Me.lst_Leaders.Visible = True
End If
End Sub
Using this code works only after the textfield is updated (hence the AfterUpdate sub), but I can't for the life of me figure out how to accomplish this by only entering text into the textfield (without tabbing away or pressing enter).
I tried using the On Change event procedure, but I couldn't get it working. I believe this is because the content of the textbox directly affects the content of the combobox, and I read on MS website that this can cause conflicts.
Any help is appreciated! Thanks so much.