select all

N

NukeEng85

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
R

Ryan

I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
 
N

NukeEng85

I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
Ryan said:
I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
R

Ryan

Ooops, try this
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]!))

I had one to many [NameOfCombo] in my original post.
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
Ryan said:
I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
R

Ryan

Wow, I must be tired today. Take of the last ! too. This is the correct code
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]))

--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
Ryan said:
I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
N

NukeEng85

So That took care of the other error message, but now I get this "The
expression youentered has an invalid . (dot) or ! operator or invalid
parenthesis. You may have entered an invalid identifier or typed parentheses
following the Null Constant."

By the way, should I be keeping [Forms]![SNM Type Form Query
approach]![Combo22] in my criteria and just deleting the "or" row? or should
I delete everything in my criteria and replace it with what you gave me?

Thanks so much!

Ryan said:
Ooops, try this.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]!))

I had one to many [NameOfCombo] in my original post.
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
Ryan said:
I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
R

Ryan

You should replace [NameOfForm] with the name of your form, the [NameOfCombo]
with the combobox name on that form, and NameOfTheFieldCriteriaIsOn with the
name of the field the criteria is on in your query.
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
So That took care of the other error message, but now I get this "The
expression youentered has an invalid . (dot) or ! operator or invalid
parenthesis. You may have entered an invalid identifier or typed parentheses
following the Null Constant."

By the way, should I be keeping [Forms]![SNM Type Form Query
approach]![Combo22] in my criteria and just deleting the "or" row? or should
I delete everything in my criteria and replace it with what you gave me?

Thanks so much!

Ryan said:
Ooops, try this.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]!))

I had one to many [NameOfCombo] in my original post.
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
:

I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
N

NukeEng85

hmm, I put this in:
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],SNM
Type,[Forms]![SNM Type Form Query approach]![Combo 22]))

and got "the expression you entered has a function containing the wrong
number of arguments." again...

Sorry! Thanks for continuing to try, and don't worry about the other one's
not working, I'm just grateful for the help


Ryan said:
Wow, I must be tired today. Take of the last ! too. This is the correct code.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]))

--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
Ryan said:
I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
R

Ryan

Try this.

IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22]))

All I added was the [ ] around SNMType.

We will get this to work, I have about 75 of these iif statements running
around in my apps.

--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
hmm, I put this in:
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],SNM
Type,[Forms]![SNM Type Form Query approach]![Combo 22]))

and got "the expression you entered has a function containing the wrong
number of arguments." again...

Sorry! Thanks for continuing to try, and don't worry about the other one's
not working, I'm just grateful for the help


Ryan said:
Wow, I must be tired today. Take of the last ! too. This is the correct code.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]))

--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
:

I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
N

NukeEng85

nope, still getting the same message

Ryan said:
Try this.

IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22]))

All I added was the [ ] around SNMType.

We will get this to work, I have about 75 of these iif statements running
around in my apps.

--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
hmm, I put this in:
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],SNM
Type,[Forms]![SNM Type Form Query approach]![Combo 22]))

and got "the expression you entered has a function containing the wrong
number of arguments." again...

Sorry! Thanks for continuing to try, and don't worry about the other one's
not working, I'm just grateful for the help


Ryan said:
Wow, I must be tired today. Take of the last ! too. This is the correct code.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]))

--
Please remember to mark this post as answered if this solves your problem.


:

I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
:

I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
R

Ryan

Is the SNM Type Form Query approach form open when you run the query? Is
that the actual name of the form? Is Combo22 the name of the combo. Here is
one of my query criteria that is in a live app and working. Maybe you could
look at it and see if helps.

Try this.
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22]),[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22])
My Code
IIf(IsNull([Forms]![C10]![LOFilter]),[LO#],[Forms]![C10]![LOFilter])
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
nope, still getting the same message

Ryan said:
Try this.

IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22]))

All I added was the [ ] around SNMType.

We will get this to work, I have about 75 of these iif statements running
around in my apps.

--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
hmm, I put this in:
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],SNM
Type,[Forms]![SNM Type Form Query approach]![Combo 22]))

and got "the expression you entered has a function containing the wrong
number of arguments." again...

Sorry! Thanks for continuing to try, and don't worry about the other one's
not working, I'm just grateful for the help


:

Wow, I must be tired today. Take of the last ! too. This is the correct code.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]))

--
Please remember to mark this post as answered if this solves your problem.


:

I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
:

I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
N

NukeEng85

The form is open, it is the actual name and the same with Combo22. Your's
looks the same as mine so I have no idea why mine isn't working. Is there
another way to do this?

Ryan said:
Is the SNM Type Form Query approach form open when you run the query? Is
that the actual name of the form? Is Combo22 the name of the combo. Here is
one of my query criteria that is in a live app and working. Maybe you could
look at it and see if helps.

Try this.
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22]),[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22])
My Code
IIf(IsNull([Forms]![C10]![LOFilter]),[LO#],[Forms]![C10]![LOFilter])
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
nope, still getting the same message

Ryan said:
Try this.

IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22]))

All I added was the [ ] around SNMType.

We will get this to work, I have about 75 of these iif statements running
around in my apps.

--
Please remember to mark this post as answered if this solves your problem.


:

hmm, I put this in:
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],SNM
Type,[Forms]![SNM Type Form Query approach]![Combo 22]))

and got "the expression you entered has a function containing the wrong
number of arguments." again...

Sorry! Thanks for continuing to try, and don't worry about the other one's
not working, I'm just grateful for the help


:

Wow, I must be tired today. Take of the last ! too. This is the correct code.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]))

--
Please remember to mark this post as answered if this solves your problem.


:

I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
:

I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
R

Ryan

IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22]),[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22])
This didnt work? If not I have no idea why.

--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
The form is open, it is the actual name and the same with Combo22. Your's
looks the same as mine so I have no idea why mine isn't working. Is there
another way to do this?

Ryan said:
Is the SNM Type Form Query approach form open when you run the query? Is
that the actual name of the form? Is Combo22 the name of the combo. Here is
one of my query criteria that is in a live app and working. Maybe you could
look at it and see if helps.

Try this.
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22]),[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22])
My Code
IIf(IsNull([Forms]![C10]![LOFilter]),[LO#],[Forms]![C10]![LOFilter])
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
nope, still getting the same message

:

Try this.

IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22]))

All I added was the [ ] around SNMType.

We will get this to work, I have about 75 of these iif statements running
around in my apps.

--
Please remember to mark this post as answered if this solves your problem.


:

hmm, I put this in:
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],SNM
Type,[Forms]![SNM Type Form Query approach]![Combo 22]))

and got "the expression you entered has a function containing the wrong
number of arguments." again...

Sorry! Thanks for continuing to try, and don't worry about the other one's
not working, I'm just grateful for the help


:

Wow, I must be tired today. Take of the last ! too. This is the correct code.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]))

--
Please remember to mark this post as answered if this solves your problem.


:

I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
:

I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 
N

NukeEng85

So that last thing you sent me worked as far as being able to successfully
enter it into the query box, but when I go and try to select something from
the combo box and run the filter, nothing happens

Ryan said:
Is the SNM Type Form Query approach form open when you run the query? Is
that the actual name of the form? Is Combo22 the name of the combo. Here is
one of my query criteria that is in a live app and working. Maybe you could
look at it and see if helps.

Try this.
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22]),[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22])
My Code
IIf(IsNull([Forms]![C10]![LOFilter]),[LO#],[Forms]![C10]![LOFilter])
--
Please remember to mark this post as answered if this solves your problem.


NukeEng85 said:
nope, still getting the same message

Ryan said:
Try this.

IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],[SNM
Type],[Forms]![SNM Type Form Query approach]![Combo 22]))

All I added was the [ ] around SNMType.

We will get this to work, I have about 75 of these iif statements running
around in my apps.

--
Please remember to mark this post as answered if this solves your problem.


:

hmm, I put this in:
IIf(IsNull([Forms]![SNM Type Form Query approach]![Combo22],SNM
Type,[Forms]![SNM Type Form Query approach]![Combo 22]))

and got "the expression you entered has a function containing the wrong
number of arguments." again...

Sorry! Thanks for continuing to try, and don't worry about the other one's
not working, I'm just grateful for the help


:

Wow, I must be tired today. Take of the last ! too. This is the correct code.
IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]))

--
Please remember to mark this post as answered if this solves your problem.


:

I got an error message when I entered the new criteria saying "the expression
you entered has a function containing the wrong number of arguments."
:

I wouldnt use an all in the query, I would use a null value, meaning nothing
at at all in the drop down. Then just ajust your criteria to look like this.

IIf(IsNull([Forms]![NameOfForm]![NameOfCombo],NameOfFieldCriteriaIsOn,[Forms]![NameOfForm]![NameOfCombo]![NameOfCombo]))

This says if the combo is null, use all values with no criteria, else use
the value in the combo as the criteria for the query.
--
Please remember to mark this post as answered if this solves your problem.


:

Using two combo boxes, need a select "all" option, so that filter turns off
for that combo box and records matching all the criteria in the first box and
only the criteria selected in the second box are retrieved.

I have this in my rowsource: SELECT DISTINCT [SNM Data].[SNM Type] FROM [SNM
Data] UNION Select "(All)" as Bogus From [SNM Data]
ORDER BY [SNM Data].[SNM Type];

and in my criteria for the query I have this
Forms!NameOfForm!NameOfCombo Or (Forms!NameOfForm!NameOfCombo Is Null)

an "all" shows up in my combo box, but when I use it as a selection, no
records come up. I want it so that ALL the records come up. Any help would
be much appreciated.
 

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