Yes/No checkboxes

R

RipperT

I have a report that contains a bound yes/no checkbox. Management (grrrr)
insists that the report show a checkbox for yes and another for no and that
one of them be checked for every record. I have accomplished this using an
option group on the form (default is 'no') and that works well enough, but I
can't figure out how to make it appear correctly on the report itself. How
do I do this?
Many thanks,
Rip
 
D

Damon Heron

Put two checkboxes on your report, one labeled Yes, one No. The control
source for Yes is the field that holds the check state.
The control source for the No checkbox = Not([yourcheckfieldname])

Damon
 
N

NKTower

Let's say the table item is MyCheck and of course it is either True or False.
You've already taken care of that on your data entry form etc.

On the report's detial line, define TWO checkboxes. Lets call them chkLeft
and chkRight

Control Source property for chkLeft is
=IIf([MyCheck],-1,0)

Control Source property for chkRight is
= Iff([MyCheck],0,-1)

What's going on here? Iif is a function ( Immediate If - phonetically
eye-eye-eff - executes for each line. It evaluages the first expression, in
our case it looks at MyCheck for True or False, and returns the 2nd arg if
True, and the 3rd if False. Thus chkLeft will be TRUE (-1) if MyCheck is
True, otherwise False, and
chkRight will be FALSE (0) if MyCheck is True, otherwise True

And management is happy. Until something else comes up.
 
J

Jason

Damons anser is simpler - you are suing extra code for yes unnessasarily.
NKTower said:
Let's say the table item is MyCheck and of course it is either True or False.
You've already taken care of that on your data entry form etc.

On the report's detial line, define TWO checkboxes. Lets call them chkLeft
and chkRight

Control Source property for chkLeft is
=IIf([MyCheck],-1,0)

Control Source property for chkRight is
= Iff([MyCheck],0,-1)

What's going on here? Iif is a function ( Immediate If - phonetically
eye-eye-eff - executes for each line. It evaluages the first expression, in
our case it looks at MyCheck for True or False, and returns the 2nd arg if
True, and the 3rd if False. Thus chkLeft will be TRUE (-1) if MyCheck is
True, otherwise False, and
chkRight will be FALSE (0) if MyCheck is True, otherwise True

And management is happy. Until something else comes up.




RipperT @nOsPaM.nEt> said:
I have a report that contains a bound yes/no checkbox. Management (grrrr)
insists that the report show a checkbox for yes and another for no and that
one of them be checked for every record. I have accomplished this using an
option group on the form (default is 'no') and that works well enough, but I
can't figure out how to make it appear correctly on the report itself. How
do I do this?
Many thanks,
Rip
 
Top