Check Box query issue

J

JHB

I have a table which contains active and inactive clients, with the
inactive clients marked with a checkbox saying "Inactive".

I have a set of parameters in a parms file, one of which tells the
system to select either ALL clients or just those who DO NOT have a
check mark in the Inactive box. If inactive clients are NOT wanted,
the the parameter box is checked.

I have an append query which is selecting client records, and one of
the criteria is whether the client is active or inactive. I have a set
of criteria for the active/inactive box that look as follows:

IIf([Parms]![DoNOTShowInactive:]=-1,No,-1 Or 0)

They work fine for selecting JUST ACTIVE, but the alternate action
JUST selects incative when I want both active and inactive. Put
another way, if the parms box is NOT checked, I want this test to be
ignored!

I have played with this for a while and know I am making a simple
mistake -- but cant see what it is.

Help??


Thanks
 
B

Bob Quintal

I have a table which contains active and inactive clients, with
the inactive clients marked with a checkbox saying "Inactive".

I have a set of parameters in a parms file, one of which tells the
system to select either ALL clients or just those who DO NOT have
a check mark in the Inactive box. If inactive clients are NOT
wanted, the the parameter box is checked.

I have an append query which is selecting client records, and one
of the criteria is whether the client is active or inactive. I
have a set of criteria for the active/inactive box that look as
follows:

IIf([Parms]![DoNOTShowInactive:]=-1,No,-1 Or 0)

They work fine for selecting JUST ACTIVE, but the alternate action
JUST selects incative when I want both active and inactive. Put
another way, if the parms box is NOT checked, I want this test to
be ignored!

I have played with this for a while and know I am making a simple
mistake -- but cant see what it is.

Help??


Thanks

the IIF function returns 1 value, always 1 value. your or stetement
tries to return 2 values, Besides, the or in Access is a boolean
comparisaon, so it will return the boolean value of -1

What you can do, is set your criteria to check a range of values like
this:
= IIF([Parms]![DoNOTShowInactive]=-1,0,-1)
by the way, you show a colon in the textbox name, that can also cause
part of your problem.
 
J

JHB

I have a table which contains active and inactive clients, with
the inactive clients marked with a checkbox saying "Inactive".
I have a set of parameters in a parms file, one of which tells the
system to select either ALL clients or just those who DO NOT have
a check mark in the Inactive box. If inactive clients are NOT
wanted, the the parameter box is checked.
I have an append query which is selecting client records, and one
of the criteria is whether the client is active or inactive. I
have a set of criteria for the active/inactive  box that look as
follows:
IIf([Parms]![DoNOTShowInactive:]=-1,No,-1 Or 0)
They work fine for selecting JUST ACTIVE, but the alternate action
JUST selects incative when I want both active and inactive. Put
another way, if the parms box is NOT checked, I want this test to
be ignored!
I have played with this for a while and know I am making a simple
mistake -- but cant see what it is.

Thanks

the IIF function returns 1 value, always 1 value. your or stetement
tries to return 2 values, Besides, the or in Access is a boolean
comparisaon, so it will return the boolean value of -1

What you can do, is set your criteria to check a range of values like
this:
= IIF([Parms]![DoNOTShowInactive]=-1,0,-1)

by the way, you show a colon in the textbox name, that can also cause
part of your problem.

Thanks
 
J

JHB

I have a table which contains active and inactive clients, with
the inactive clients marked with a checkbox saying "Inactive".
I have a set of parameters in a parms file, one of which tells the
system to select either ALL clients or just those who DO NOT have
a check mark in the Inactive box. If inactive clients are NOT
wanted, the the parameter box is checked.
I have an append query which is selecting client records, and one
of the criteria is whether the client is active or inactive. I
have a set of criteria for the active/inactive  box that look as
follows:
IIf([Parms]![DoNOTShowInactive:]=-1,No,-1 Or 0)
They work fine for selecting JUST ACTIVE, but the alternate action
JUST selects incative when I want both active and inactive. Put
another way, if the parms box is NOT checked, I want this test to
be ignored!
I have played with this for a while and know I am making a simple
mistake -- but cant see what it is.

Thanks

the IIF function returns 1 value, always 1 value. your or stetement
tries to return 2 values, Besides, the or in Access is a boolean
comparisaon, so it will return the boolean value of -1

What you can do, is set your criteria to check a range of values like
this:
= IIF([Parms]![DoNOTShowInactive]=-1,0,-1)

by the way, you show a colon in the textbox name, that can also cause
part of your problem.

Thanks...stupid mistake!
 

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