I have a textbox that I'm using as a search field: txtAddress. I have a query that is based on that field using the Like keyword so that I can have wildcards. What I would like to happen is that as I type each character into txtAddress, the subform (that is based on the query) requeries. Here is what I currently have:
It seems like it is always one change behind. At first I didn't have the 2nd line and nothing happened. That is when I figured out that the value of the field hadn't changed for the query to see it yet, so I had it save and then requery. Now it will change, but if I start to enter 11, and then backspace and then type 80, then it still shows the addresses that starts with 11. If I manually run the query after making the change to txtAddress and then leave the field, the query runs exactly as expected so I know it is in my OnChange event that I'm messing up.
Code:
Private Sub txtAddress_Change() If Me.Dirty = True Then Me.Dirty = False Me.sfrmAddressSearchResults.Requery End Sub
Comment