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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter using a query

Status
Not open for further replies.

kev747

Technical User
Jan 30, 2003
68
AU
Hey all.
I have a form that I use to select records based upon fields in that form. For example, on my form I have the following fields - Manager, Work Area, Result etc.

The user can enter a value in either of these fields via a combo box. When they click a command button, a new form is opened displaying the records that match the critera based upon their filter selections. So they should be able to select either, or all of these fields.

My problem is that all fields need to have a value entered, or the query returns a blank screen.

How can I use the criteria field of the query to either select the enrty made on the form ((Forms)!(frmdatabasesearch)!(cboworkarea)), or if the field is null, then select all records?

Thanks in advance.

Kev.



Never trust the French.
How can you trust a country that has 256 different types of cheese.
- Spike Milligan.
 
Hi

How about amending the criteria in you query along the lines of

IsNull(Forms![frmdatabasesearch]![cboworkarea]) Or [Colname]=Forms![frmdatabasesearch]![cboworkarea])

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi
Oops, forgot to say, in case it is not obvious [ColName] is the name of your column, eg maybe WorkArea in this example

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top