Query parameters for search

  • Thread starter Igor via AccessMonster.com
  • Start date
I

Igor via AccessMonster.com

Hi all out there..

Am I on the right track? I have set up a query to search my records. I want
to search by 6 fields which are inputted from a Form. I am using

Like [Forms]![frmMembers]![combobox] & "*" or Is Null

as the criteria where combobox are the parameters entered on the form. Im
getting all of my records returned with any search, is this because when a
combobox is empty, it adds every record?

What I want, is:
1 The query uses the comboboxes for the search parameters
2 If all comboboxes are empty, all records are returned.
3 If a combobox is filled in, but another is empty, the search only uses the
filled in combobox.

Any suggestions?

Thanks all...
 
G

Guest

Try it like this:

Like Nz([Forms]![frmMembers]![combobox], "*")

It uses the Nz function to replace the value of the combo box with * if the
combo box is null; otherwise, it uses the value in the combo.
 

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