When a checkbox is checked it has a value of -1 and unchecked 0. The
absolute value of -1 is 1 so if any checkbox is checked the sum of the
checkboxes is greater than 0. You can use this fact to accomplish your goal.
Put the following expression in the control source of the textbox where you
currently display whether the patient is eligible or not:
=IIF(Sum(Abs(ChkBox1) + Abs(ChkBox2) ..... Abs(ChkBox7)) = 0,"Patient Is
Eligible","Patient Is Not Eligible")
The textbox will automatically display "Patient Is Eligible" when no
checkboxes are checked and automatically display "Patient Is Not Eligible"
when any checkbox is ckecked.
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com
> To be eligible for a study, a patient has to meet certain criteria.
> There are 7 things that could prevent the patient from being eligible
[quoted text clipped - 29 lines]
>
> Kurt
> =IIF(Sum(Abs(ChkBox1) + Abs(ChkBox2) ..... Abs(ChkBox7)) = 0,"Patient Is
> Eligible","Patient Is Not Eligible")
I've tried this and many permutations, but the text box keeps
returning "#Error" I'm definitely referring to correct names for the
check box controls, too. For instance, just to keep it simple, this
abbreviated version returns "#Error."
=IIf(Sum(Abs([ChkBox1])+Abs([ChkBox2]))=0,"Eligible","Not Eligible")
Any ideas?
> When a checkbox is checked it has a value of -1 and unchecked 0. The
> absolute value of -1 is 1 so if any checkbox is checked the sum of the
[quoted text clipped - 52 lines]
>
> - Show quoted text -
Marshall Barton - 10 Jun 2007 22:03 GMT
>> =IIF(Sum(Abs(ChkBox1) + Abs(ChkBox2) ..... Abs(ChkBox7)) = 0,"Patient Is
>> Eligible","Patient Is Not Eligible")
[quoted text clipped - 5 lines]
>
>=IIf(Sum(Abs([ChkBox1])+Abs([ChkBox2]))=0,"Eligible","Not Eligible")
Rhe aggregate functions only operate on **fields** (not
controls) in a form/report's record source table/query.
Are you sure you want to count all the field1s that a true?
It seems like you rally want to use:
=IIF(Abs(ChkBox1) + Abs(ChkBox2) +...+ Abs(ChkBox7)) =
0,"Patient Is Eligible","Patient Is Not Eligible")

Signature
Marsh
MVP [MS Access]
Steve - 10 Jun 2007 22:14 GMT
My mistake!
Remove the Sum function and just add the absolute values of the checkboxes
together:
=IIF(Abs(ChkBox1) + Abs(ChkBox2) ..... Abs(ChkBox7) = 0,"Patient Is
Eligible","Patient Is Not Eligible")
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com
>> =IIF(Sum(Abs(ChkBox1) + Abs(ChkBox2) ..... Abs(ChkBox7)) = 0,"Patient Is
>> Eligible","Patient Is Not Eligible")
[quoted text clipped - 67 lines]
>>
>> - Show quoted text -