Filter Using a Command Button

K

Katherine

Hi,

I've been reading many access forums and have found nothing that quite
fits with what I'm trying to do.

I've got a database that I would like to be able to search by name
parts. For example, if I typed in "smi" as the search criteria, the
filter would give me people named Smith, Smithson, Naismith, and
everything possible that had the string "smi" in it. It would be case
insensitive.

I've tried using filter by form to do this, but it will return results
containing only the string I enter rather than the string and all
variations thereof. Filter by selection seems to do what I want, but I
have to actually highlight a string of characters I want to use and
then hit filter. I can't type in my own string and use that without
changing records somehow.

If there's a way to make this happen using functions that are built
into Access, that would be great, and that would be my preference. If
I'm not so lucky...

My newest idea is to have a command button that pops up a box where
users can enter some string of characters to search by. Ideally I'd
have one each for first name, last name, and company, but may want to
add more as they become necessary. I know how to make a command button
and do an OnClick event, but the code to make such a search is a bit
out of my reach.

Do you have any advice? Code? Websites you can point me to?

Thanks for the help!
Katherine
 
C

Chris M via AccessMonster.com

Hi Katherine,

Enclose your string in *, ie. *smi*, will return any words that contain smi.
 

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