Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searches using multiple values from a form

Status
Not open for further replies.

kev747

Technical User
Jan 30, 2003
68
0
0
AU
Hey all,
I'm a bit of a newbie when it comes to creating queries, so any advice is welcome.

I have a basic database that holds the majority of records in a single table. Data is entered via a form linked to the table.

I have created a form that users can use to search the database. Basically I want the search form to be a replica of the data entry form so that the users can search the records by whatever field they want. All fields are combo boxes on the search form so that only valid values can be searched for.

My question is, how do a I create a query that will look at what value the user entered into a field, but ignore the null values in the other fields. It may also be that the user will want to refine their search by entering values into two or more fields.

I know that I can write multiple queries to do this, but I figure there must be a way to do it easier than that.

Can a query be written to accomplish this?

Thanks in advance for any help offered.

Cheers.

Kev.



This is a politically correct signature, due to constant whinging about my previous signature.
Long live the fun police.
 
I assume there is some sort of criteria form where they are entering the information and the users only have to fill out the section that they want.

In that case, I guess you make each field have a default value of "*" and have the users override that valaue if they have to search in that field.

Or...maybe check for null values in the query with an if statement. If field1 is null, then "*" else field1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top