Yes/No

P

PC Datasheet

In a query, include the Yes/No field. Change the query to a totals query by
clicking on the Sigma (looks like E) button on the toolbar at the top of the
screen. Go down to the Yes/No field in the query and change Group By to
Count. Run the query to get the count of Yeses and Noes.

For a table, use DCount function. Put the following expression in the
controlsource of a textbox:
=DCount("*","NameOfTable",""[NameOfYesNoField] = True) 'Count of Yeses
=DCount("*","NameOfTable",""[NameOfYesNoField] = False) 'Count of Noes

In a form based on a query, use DCount function. Put the following
expression in the controlsource of a textbox:
=DCount("*","NameOfQuery",""[NameOfYesNoField] = True) 'Count of Yeses
=DCount("*","NameOfQuery",""[NameOfYesNoField] = False) 'Count of Noes
 
F

fredg

Hi,
Please advise how best to count Yes/No data.
Regards.
Rayh

The easiest ways to do this are:

Yes:
=Abs(Sum([CheckBoxName]))

No:
=Sum(IIf([CheckBoxName] = 0,1,0))
or
No:
=Sum([CheckBoxName]+1)
 

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

Similar Threads

Toshiba Models 2
Command Button on Report 1
CreateField 1
SetValue 5
ActiveX 1
SELECT TOP 1
TimeSerial 5
Record Count on Forms 3

Top