473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

count checkbox values

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
2 6231
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Angelos | last post by:
I have this list of logs stored in a MySQL DB. I display them in a list and next to each log I have a del view LINK I want to add Checkboxes next to each log and keep del and view links as...
1
by: Hunter | last post by:
Hi group - I'm using php to extract data from postgres and print to browser. I have data that was input through checkboxes on a form - each checkbox had a different value but got pushed into the...
10
by: suzy | last post by:
i have generated a list of checkboxes (at runtime) using the checkboxlist control. i want to add an onclick event onto each checkbox so i can perform a count of how many items have been...
4
by: Vanessa | last post by:
I have an ASP script which is used to upload files with Persits.Upload.1 object. But I can't get the values from mutliple checkboxes in the form like normally. <form method="post"...
1
by: J Talbot | last post by:
Hi Was wondering if anyone could help me with this problem : If I have three checkboxes with different values on a form like : <input type="checkbox" name="checkbox" value="1stValue">...
6
by: Chuck Anderson | last post by:
My knowledge of JavaScript is limited. I learn from example and then adapt those examples to suit my needs. I have stumped myself on this one. I have a form with checkboxes that I want to...
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
10
by: LionsDome | last post by:
Hello, I have a vb.net page which a bunch of checkboxes. A user can select a checkbox(s) and hit the submit button to store those values in a SQL Server table. This works fine with no problem...
14
by: zufie | last post by:
I have to create a QA report regarding callers calling into a phone hotline. The report consists of many checkboxes such as: Did the IBCCP agency contact you? Yes/NO How many days passed...
9
by: raamay | last post by:
I have six checkboxes as shown below: <table> <tr> <td><input name="spec1" type="checkbox" value="0" tabindex="11" /><label id="label">Bridge Construction</label></td> </tr> <tr> <td><input...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.