Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 393
  • Last Modified:

Count Checkboxes ticked in multiple forms

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
CptPicard
Asked:
CptPicard
  • 5
  • 4
2 Solutions
 
mbizupCommented:
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
 
CptPicardAuthor Commented:
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
 
mbizupCommented:
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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
mbizupCommented:
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
 
CptPicardAuthor Commented:
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
 
CptPicardAuthor Commented:
You just answered my question above.  Let me give this a go...
0
 
mbizupCommented:
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
 
CptPicardAuthor Commented:
Perfect Thanks
0
 
mbizupCommented:
Glad to help :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now