LanaR
Member
- Local time
- Tomorrow, 07:41
- Joined
- May 20, 2021
- Messages
- 113
I'm currently creating a pseudo combo box. The aim being to create a combo box that has a more flexible search.
I'm using an unbound text box and button with an unbound list box (populated using data input into the text box, it's row source being a query that uses a Like "*" & [me.textbox] & "*" criteria to search any part of the data) to simulate the dropdown. I've got everything working pretty much as I want. However, I have found a hurdle when it comes to detecting when focus has moved from the group to another control. I've tried using the Lost Focus event to test which control has focus, the issue here is that that simply returns the name of the control to which the event belongs. My next thought was to use the Got Focus events of other controls on the form to test if the list box is visible and hide it if so.
That would certainly work, but becomes rather tedious if you have more than a couple of additional control on the form. Is there another method I could use to hide the list box once the user has finished with it?
I'm using an unbound text box and button with an unbound list box (populated using data input into the text box, it's row source being a query that uses a Like "*" & [me.textbox] & "*" criteria to search any part of the data) to simulate the dropdown. I've got everything working pretty much as I want. However, I have found a hurdle when it comes to detecting when focus has moved from the group to another control. I've tried using the Lost Focus event to test which control has focus, the issue here is that that simply returns the name of the control to which the event belongs. My next thought was to use the Got Focus events of other controls on the form to test if the list box is visible and hide it if so.
That would certainly work, but becomes rather tedious if you have more than a couple of additional control on the form. Is there another method I could use to hide the list box once the user has finished with it?