Solved Searchable List Box on Form (1 Viewer)

Hecronis

Registered User.
Local time
Today, 06:02
Joined
Apr 26, 2016
Messages
60
I have a list box that I would like to make searchable. What I would like to have is when nothing is in the "Search Box" the list box shows all entries but when the "Search Box" has something in it and the person presses the Search Button it brings up the results in the list box.

I only know how to make it do one or the other. Either show all results and not be able to search or search and it not show any results when the search box is blank.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 04:02
Joined
Oct 29, 2018
Messages
21,467
Hi. Perhaps you could use an If/Then block. You know, like.

Code:
If SearchBox is empty Then
    'show all
Else
    'show search result
End If
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:02
Joined
May 7, 2009
Messages
19,234
maybe some sample will help you.
see the code-behind the textbox.
 

Attachments

  • searchList.accdb
    460 KB · Views: 193

Hecronis

Registered User.
Local time
Today, 06:02
Joined
Apr 26, 2016
Messages
60
maybe some sample will help you.
see the code-behind the textbox.
That worked perfect! I had to do a little modifying to match up with my db but it is good to go. Thank you.
 

LanaR

Member
Local time
Today, 21:02
Joined
May 20, 2021
Messages
113
I know I'm late to the discussion, but search in sample Database section of the forum for "Dynamically search multiple fields" and have a look at that DB, it's a really handy example
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:02
Joined
Jul 9, 2003
Messages
16,280
sample Database section of the forum for "Dynamically search multiple fields"

Do you mean this one?
 

LanaR

Member
Local time
Today, 21:02
Joined
May 20, 2021
Messages
113
That's the one I got an error when I tried to post a link to it :rolleyes:
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 12:02
Joined
Jul 9, 2003
Messages
16,280
That's the one I got an error when I tried to post a link to it :rolleyes:

I believe the forum software stops you making posts until you've built at the reasonable level of responses. This helps reduce spam and work for the moderators...
 

Users who are viewing this thread

Top Bottom