C
ChuckW
Hi,
I have a database of people around the world that have
taken various classes. I have a query called
SearchDBQuery with fields that include Name, City, State,
Country and ClassName. The state field is not restricted
to US states. For instance, in the United Kingdom, I
have state values as well. However, most state fields for
foreign people are blank but not all. I have a form
called SearchDatabase with three combo boxes called
comboState, comboCountry and comboClass and a button that
runs a report. I want to allow the user to be able to
select one, two or all three values in these combo boxes
which would then bring back the results in the report. I
placed the following in the criteria of my state field:
Like IIf(IsNull([Forms]![SearchDatabase]!
[ComboState]),"*",[Forms]![SearchDatabase]![ComboState])
When a user selects Georgia it brings back all of the
people who live in Georgia. I also created the following
in the criteria of my country field:
Like IIf(IsNull([Forms]![SearchDatabase]![ComboCountry]),
"*",[Forms]![SearchDatabase]![ComboCountry])
The problem is that when I select a country (ie the
United Kingdom) and leave the state field blank by not
selecting anything with my comboState box I only get
people who do not have a value for the state field in the
UK. What I want is to get everyone in the UK regardless
of if they have a value there or not.
What change do I need to make to my query to make this
happen?
Thanks,
Chuck
I have a database of people around the world that have
taken various classes. I have a query called
SearchDBQuery with fields that include Name, City, State,
Country and ClassName. The state field is not restricted
to US states. For instance, in the United Kingdom, I
have state values as well. However, most state fields for
foreign people are blank but not all. I have a form
called SearchDatabase with three combo boxes called
comboState, comboCountry and comboClass and a button that
runs a report. I want to allow the user to be able to
select one, two or all three values in these combo boxes
which would then bring back the results in the report. I
placed the following in the criteria of my state field:
Like IIf(IsNull([Forms]![SearchDatabase]!
[ComboState]),"*",[Forms]![SearchDatabase]![ComboState])
When a user selects Georgia it brings back all of the
people who live in Georgia. I also created the following
in the criteria of my country field:
Like IIf(IsNull([Forms]![SearchDatabase]![ComboCountry]),
"*",[Forms]![SearchDatabase]![ComboCountry])
The problem is that when I select a country (ie the
United Kingdom) and leave the state field blank by not
selecting anything with my comboState box I only get
people who do not have a value for the state field in the
UK. What I want is to get everyone in the UK regardless
of if they have a value there or not.
What change do I need to make to my query to make this
happen?
Thanks,
Chuck