Varying criteria for True/False field

  • Thread starter Thread starter jhicsupt via AccessMonster.com
  • Start date Start date
J

jhicsupt via AccessMonster.com

I have a True/False field. However I want to be able to include/not include
records more than True/False. In this query, if I put "True", it will
include only those records for Boston. However I want to be able to include
one of the following, but prompt the user to see what they want to include:
All Records
Just records <> "Boston"
Just "Boston"

Field name is District.

How can I accomplish this?

Thanks in advance.
 
I don't understand enough about your data structure to tell how your T/F
field is related to "Boston".

If you are asking how to add more than one selection criterion to a query,
open the query in design mode and add the additional criteria.
 
You're trying to use a boolean checkbox to represent three states (True
False and All).
There is however a way you should be able to do it.

Try setting the TripleState for your checkbox to Yes. This will allow
True, False, and Null states.
I'd then use the [Where] argument of OpenReport to pass that selection to
the report.
True = "Boston"
False <> "Boston"
Null Like "*"

hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
Here's what I ended up with and is working fine (came across another thread
that led me to use this)...

IIf(IsNull([Enter Y to EXCLUDE Boston records or click OK for All Records]),
[District],IIf([Enter Y to EXCLUDE Boston records or click OK for All Records]
="Y",0,0))

Thanks to all who responded.


Al said:
You're trying to use a boolean checkbox to represent three states (True
False and All).
There is however a way you should be able to do it.

Try setting the TripleState for your checkbox to Yes. This will allow
True, False, and Null states.
I'd then use the [Where] argument of OpenReport to pass that selection to
the report.
True = "Boston"
False <> "Boston"
Null Like "*"

hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
I have a True/False field. However I want to be able to include/not
include
[quoted text clipped - 12 lines]
Thanks in advance.
 
I may be reading too much into your posts, but it sounds like you have a T/F
for Boston. Does this mean you also have a T/F for Cambridge, a T/F for
...., and a T/F for each town? If so, your database could benefit from
further normalization.

Regards

Jeff Boyce
<Office/Access MVP>

jhicsupt via AccessMonster.com said:
Here's what I ended up with and is working fine (came across another thread
that led me to use this)...

IIf(IsNull([Enter Y to EXCLUDE Boston records or click OK for All Records]),
[District],IIf([Enter Y to EXCLUDE Boston records or click OK for All Records]
="Y",0,0))

Thanks to all who responded.


Al said:
You're trying to use a boolean checkbox to represent three states (True
False and All).
There is however a way you should be able to do it.

Try setting the TripleState for your checkbox to Yes. This will allow
True, False, and Null states.
I'd then use the [Where] argument of OpenReport to pass that selection to
the report.
True = "Boston"
False <> "Boston"
Null Like "*"

hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
I have a True/False field. However I want to be able to include/not
include
[quoted text clipped - 12 lines]
Thanks in advance.
 
District wasn't really a field that had a Yes/No, but the field I was using
wouldn't had made sense to anyone else but me, so I just picked anything to
make my example. Probably I chose a bad example :(

Jeff said:
I may be reading too much into your posts, but it sounds like you have a T/F
for Boston. Does this mean you also have a T/F for Cambridge, a T/F for
..., and a T/F for each town? If so, your database could benefit from
further normalization.

Regards

Jeff Boyce
Here's what I ended up with and is working fine (came across another thread
that led me to use this)...
[quoted text clipped - 27 lines]
 
Whether your "Boston" is a city or a district, my point is still the same.
If you are using multiple Y/N (T/F) fields to handle multiple cities,
districts, dates, (or anything else), your database may need further
normalization.

--
Regards

Jeff Boyce
<Office/Access MVP>

jhicsupt via AccessMonster.com said:
District wasn't really a field that had a Yes/No, but the field I was using
wouldn't had made sense to anyone else but me, so I just picked anything to
make my example. Probably I chose a bad example :(

Jeff said:
I may be reading too much into your posts, but it sounds like you have a T/F
for Boston. Does this mean you also have a T/F for Cambridge, a T/F for
..., and a T/F for each town? If so, your database could benefit from
further normalization.

Regards

Jeff Boyce
Here's what I ended up with and is working fine (came across another thread
that led me to use this)...
[quoted text clipped - 27 lines]
Thanks in advance.
 
Back
Top