Radio Button Box vs. check box field in a query.

smcfadden777

Registered User.
Local time
Today, 11:20
Joined
May 24, 2012
Messages
10
I have a field that is populated by a yes/no check box.

This field tells whether a Client is active.

I have a report that lists all clients and corrosponding Info.

I have a Radio Button Box called "Active Client Button" with three radio buttons, this box gives the user the option of runing the report for Active, InActive or All Clients:

The buttons have the values:
Active = 1
InActive = 2
All Clients = 3

I am using the following criteria for the check box field:

IIf([Forms]![Contact Details]![Active Client Button]=1,True,IIf([Forms]![Contact Details]![Active Client Button]=2,False,"")

This produces a True if the button box value is 1, A False if the value is 2 and nothing if the button box value is 3.

This works for the Active and Inactive buttons but I cannot find an "else" place holder to put in the "" that allows the checkbox field to give all client records (as it does if no criteria were present). I get nothing or an error message "Expression too long etc."

Does anyone know how best to use the radio button box to get the null value (I've tried Null) in a checkbox field criteria?

Thank you.
 
"" is not nothing, but a zero-length string. And Access presumably objects in the instances where IIF wants to put a "" into a Boolean field.

All this is much too complicated anyway.

You have an option group that gives you three options and thus 3 values (1,2,3) just store 1,2 or 3 and then resolve that into an appropriate criterion to give you what you need, when needed. Or -1, 0, 1 because -1 (Yes) or 0 (No) can be compared directly with a boolean field, and 1 would then signify -1 OR 0 (to get both possible outcomes)

Why is a temporary value stored in a field anyway?
 
Thank you for your response.

Not sure which value is considered a temporary value. The check box field holds the active/inactive status of the client and will always be an identifier of the client.

The checkbox only stores the -1 or 0 (True or False), so I am not sure what you mean by "store 1,2 or 3 and then resolve that into an appropriate criterion." these numbers from the button box are not being stored they just facilitating the criteria to query the report.

Seems like there should be something to place in the "" to make the criteria think there is nothing there.
 
Hi there, i just found this thread, and i have the exact same situation...

Did you find a solution to the problem ?
 

Users who are viewing this thread

Back
Top Bottom