Solved Remove focus from ListBox (1 Viewer)

yamus

Member
Local time
Today, 13:16
Joined
Aug 12, 2020
Messages
81
Hi
I have a ListBox that shows search results based on some criteria
What i want is that after each click on the search button (new search) to remove the focus (highlight) generated on the listbox after clicking on it
Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:16
Joined
Oct 29, 2018
Messages
21,454
If you have other controls on the form, you can send the focus to one of them. For example:

Me.ControlName.SetFocus
 

yamus

Member
Local time
Today, 13:16
Joined
Aug 12, 2020
Messages
81
If you have other controls on the form, you can send the focus to one of them. For example:

Me.ControlName.SetFocus
Hello
Thanks for the suggestion but it did not help 😁
Now the clicked listbox row and the other control are both highlighted
 

isladogs

MVP / VIP
Local time
Today, 13:16
Joined
Jan 14, 2017
Messages
18,209
That's because the listbox item is still selected.
If you want to deselect it then add the code line:

Code:
Me.YourListboxName=Null
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:16
Joined
Oct 29, 2018
Messages
21,454
Hello
Thanks for the suggestion but it did not help 😁
Now the clicked listbox row and the other control are both highlighted
Hi. Sorry, I guess I misunderstood your requirement.
 

yamus

Member
Local time
Today, 13:16
Joined
Aug 12, 2020
Messages
81
That's because the listbox item is still selected.
If you want to deselect it then add the code line:

Code:
Me.YourListboxName=Null
It worked fine. Thank you very much
 

Users who are viewing this thread

Top Bottom