By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,072 Members | 1,200 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,072 IT Pros & Developers. It's quick & easy.

count checkbox values

P: n/a
Hi
I have a table which asks how people heard about a subject. As it is one to
many I have created checkboxes for each option. Trouble is I now want a
report which will give each option and a count of how many times it has been
selected.

Can anyone help?

James
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Access stores True as -1, and False as 0.
You can therefore sum a yes/no field, and negate the result to get a count,
i.e.:
- Sum([MyYesNoField])

You say you do this quite a bit, so you might want to consider doing the job
properly. To design it in a normalized way, you would use a junction table
to handle the many-to-many relation between tables Person and HowHeard.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"James" <j.*******@stir.ac.uk> wrote in message
news:dk**********@dulnain.stir.ac.uk...
Hi
I have a table which asks how people heard about a subject. As it is one
to many I have created checkboxes for each option. Trouble is I now want a
report which will give each option and a count of how many times it has
been selected.

Can anyone help?

James

Nov 13 '05 #2

P: n/a
Thanks for that Allen, you have been a great help to me over the years. I
will check out the junction table. I currently have event and person, and I
thought I had done the job by having the many to many howheard table?

cheers
James

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:43***********************@per-qv1-newsreader-01.iinet.net.au...
Access stores True as -1, and False as 0.
You can therefore sum a yes/no field, and negate the result to get a
count, i.e.:
- Sum([MyYesNoField])

You say you do this quite a bit, so you might want to consider doing the
job properly. To design it in a normalized way, you would use a junction
table to handle the many-to-many relation between tables Person and
HowHeard.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"James" <j.*******@stir.ac.uk> wrote in message
news:dk**********@dulnain.stir.ac.uk...
Hi
I have a table which asks how people heard about a subject. As it is one
to many I have created checkboxes for each option. Trouble is I now want
a report which will give each option and a count of how many times it has
been selected.

Can anyone help?

James


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.