Finding Record in List Box

S

Skennelly

Is it possible to search for a record in an unbound list box using an unbound
text box and command button on a form? I have approximately 1000 records in
the list box and would like to use a search string with the Like character to
narrow the search, rather than scrolling through all of the records. I am not
sure if I can clone the recordset and use the Find method on a list box.

Thank You. Skennelly
 
J

Jeff Boyce

Actually, even though you see the rows in your listbox, they really are in
the underlying table(s).

You could write a query that uses the same source as your listbox, but adds
the criterion, in the designated field, of:

Like Forms!YourForm!txtYourSearchTextBox & *

You ARE searching in only one field, right?!
 
J

Jason

Jeff Boyce said:
Actually, even though you see the rows in your listbox, they really are in
the underlying table(s).

You could write a query that uses the same source as your listbox, but adds
the criterion, in the designated field, of:

Like Forms!YourForm!txtYourSearchTextBox & *

You ARE searching in only one field, right?!

--
Good luck

Jeff Boyce
<Access MVP>

character am

HI,

I was using the same, but which event should i use if want it to search on
change,? I used the onchange event and a requery, but the cursor in the
textbox don't let me type a second character.

Thnx

J
 
J

Jeff Boyce

If you have a command button, why are you using "OnChange"?

Jeff Boyce
<Access MVP>
 
S

Skennelly

Jeff:

Thank you for your help. I was able to complete the task as you explained
it. I appreciate it.

Skennelly
 
J

Jason

Jeff Boyce said:
If you have a command button, why are you using "OnChange"?

Jeff Boyce
<Access MVP>

are

Isn't that better to use? Also how should i search for records if i use more
than one field?
 
J

Jeff Boyce

Jason

I'm not sure what other settings you might be using that would prevent more
than one character in your textbox.

If you are setting up a multi-field "search" form, take a look at the
mvps.org website, and search at Google.com on this topic. There's a lot
already written on it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top