Solved

Count Checkboxes ticked in multiple forms

Posted on 2013-12-08
9
364 Views
Last Modified: 2013-12-08
Hi -

I have 6 forms which have about 10 questions each and roughly 4 tick boxes for each question.

I need to create a report which calculates the total number of times these tick boxes are clicked.  

For example, if I have 100 records and for question 1 on the first form the 'Confirmed' tick box was ticked, lets say, 67 times, then in the report, for this question and this tick box, it will display the sum 67.  Unfortunately, I have 6 forms and and lots of check boxes so I've got to do this for every tick box in every form :(

In the report, I have made the record source see all 6 tables and I've included all the tick boxes so the fields are available.

I use Access 2010.

some of the things I've tried adding to my report below in a text box.

Sum(IIf(Me![tbl_questions1.e1confirmed]=True,1,0))
=Count([tbl_questions.e1confirmed])

Hope this makes sense

Thanks.
0
Comment
Question by:CptPicard
  • 5
  • 4
9 Comments
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 500 total points
ID: 39704910
In the Footer (or Header) section of each form, use this as the control source for a Textbox called txtConfirmed:

= ABS(Sum([Confirmed]))

Open in new window


Make sure that Confirmed is the name of the field in the table (not the name of the checkbox on the form).


Then in the control source of a textbox on your report:

= Forms!Form1!txtConfirmed +  Forms!Form2!txtConfirmed  +  Forms!Form3!txtConfirmed  +  Forms!Form4!txtConfirmed  ... etc

Open in new window



And then use the same approach for each of the four checkboxes that you need to total.
0
 

Author Comment

by:CptPicard
ID: 39704931
I'm sure I've followed your instructions exactly but for some reason my text box just says #Name?

So I tried making it more simple and just typing in the text box

= Forms!Questions1!txtConfirmed

But that does the same.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39704938
Are  you positive that you have the names exactly right:

FormName!Questions1

Textbox:  txtConfirmed

Are there any subforms involved?

And finally, for this method to work, the question forms need to be OPEN when you run the report.
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39704944
Another method would be to use this in the textbox control source.  I'm assuming your *table* names are Questions1, Questions2, etc (include the = sign in the control source):


= DCount("*", "Questions1", "Confirmed = TRUE") +  DCount("*", "Questions2", "Confirmed = TRUE") +  DCount("*", "Questions3", "Confirmed = TRUE")    etcetera

Open in new window


The forms do not need to remain open for this method.
0
 

Author Comment

by:CptPicard
ID: 39704948
Yep it works fine when the forms are open but that's going to be a problem as the forms won't be open when users are trying to view the report?!  Anyway around this?
0
 

Author Comment

by:CptPicard
ID: 39704951
You just answered my question above.  Let me give this a go...
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39704959
Also... depending on the recordsource of your report, it might be a lot simpler.

You might be able to get by with this:

= ABS(Sum([e1Confirmed]))

Open in new window


That will work IF e1Confirmed is included as a field in your report's recordsource (not a checkbox), and it needs to be placed in a header or footer section.
0
 

Author Comment

by:CptPicard
ID: 39704961
Perfect Thanks
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39704980
Glad to help :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question