View Single Post
  #3  
Old August 28th, 2006, 06:27 PM posted to microsoft.public.access.forms
Al Campagna
external usenet poster
 
Posts: 421
Default search several fields

Raul,
Have you tried using the built in Filter By Form? That would be the easiest... if it
suits your needs. With a bit of practice, it's very useful.

Otherwise, an unbound Search Dialog form where the user enters various field values to
search for would be a good way to go.

Let's say you wanted to search for a LastName in a State.
Use criteria like these against those fields in your query...
Like Forms!frmSearchDialog!LastName & "*"
Like Forms!frmSearchDialog!State & "*"

ex. "Jones"
Is State was left null, the query would still find all Jones records regardless of
State.
ex. "Jones" "NY"
If State was indicated, the query would deliver all Jones and NY records.
ex. "J" "NY"
Would return all LastNames beginning with "J" in "NY"

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"Raul Sousa" wrote in message
...
I have a database with client's details.
Clients table has several fields; name, address, code, etc.
Sometimes users may need to search for one or several fields.

I was thinking of starting with an unbound form with all clients table fields.
The user fill all fields he may want to search for . hit the search button
and another form show the results.

I have not done something like this. I have done it with only one field
searchable.
So, any suggestions are most welcome.