Multiple Selection to Run Query

K

kirstie adam

Hi All,

I have a form which shows site records.

I want the user to be able to search by

SiteType and SiteHeight (showing all records matching that type of site with
that height)
OR
just SiteType (showing all records for all types)
OR just SiteHeight (showing all records for all heights)

I can only get the 1 or the other to work, can anyone tell me how to do
this?

The form is called "frm search multiple" and is currently bound to a qry
called "qry search multiple"

In the query, under the field SiteType i have the following

forms!frm seach multiple!cmbosite (referring to the combo box displaying
site type options
and under field SiteHeight i have
forms!frm seach multiple!cmboheight

CAN ANYONE HELP?

Kirstie
 
M

Marshall Barton

kirstie said:
I have a form which shows site records.

I want the user to be able to search by

SiteType and SiteHeight (showing all records matching that type of site with
that height)
OR
just SiteType (showing all records for all types)
OR just SiteHeight (showing all records for all heights)

I can only get the 1 or the other to work, can anyone tell me how to do
this?

The form is called "frm search multiple" and is currently bound to a qry
called "qry search multiple"

In the query, under the field SiteType i have the following

forms!frm seach multiple!cmbosite (referring to the combo box displaying
site type options
and under field SiteHeight i have
forms!frm seach multiple!cmboheight


Try changing the criteria to:

forms![frm seach multiple]!cmbosite OR forms![frm seach
multiple]!cmbosite Is Null

and

forms![frm seach multiple]!cmboheight OR forms![frm seach
multiple]!cmboheight Is Null
 
K

kirstie adam

Marshall,

Excellent thank you.

Kirstie

Marshall Barton said:
kirstie said:
I have a form which shows site records.

I want the user to be able to search by

SiteType and SiteHeight (showing all records matching that type of site with
that height)
OR
just SiteType (showing all records for all types)
OR just SiteHeight (showing all records for all heights)

I can only get the 1 or the other to work, can anyone tell me how to do
this?

The form is called "frm search multiple" and is currently bound to a qry
called "qry search multiple"

In the query, under the field SiteType i have the following

forms!frm seach multiple!cmbosite (referring to the combo box displaying
site type options
and under field SiteHeight i have
forms!frm seach multiple!cmboheight


Try changing the criteria to:

forms![frm seach multiple]!cmbosite OR forms![frm seach
multiple]!cmbosite Is Null

and

forms![frm seach multiple]!cmboheight OR forms![frm seach
multiple]!cmboheight Is Null
 

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