Automatically Calculate Percentage of Checkboxes Selected (1 Viewer)

nick1408

Registered User.
Local time
Today, 16:29
Joined
Jun 16, 2016
Messages
77
Since my last thread I have another question. Is it possible to have Access automatically calclulate the amount of checkboxes selected? I have a feeling it has something to do with grouping but really am not sure.

As a follow-on to the above; is it possible to do conditional formatting in Access? I wist to do a formula like:

if (endDate-today())>calculatedPercentage then colour 'Red' (I am aware the syntax isn't correct but feel it conveys the message I am after)

Thanks guys.
 

nick1408

Registered User.
Local time
Today, 16:29
Joined
Jun 16, 2016
Messages
77
I've worked out the conditional formatting bit. Just need to work out the checkboxes now.
 

sneuberg

AWF VIP
Local time
Yesterday, 23:29
Joined
Oct 17, 2014
Messages
3,506
Where are these checkboxes. If they are in continuous forms and are bound to a table then is might be just

DCount("*", "[table name with Yes/No Fields]", "[Yes/No Field Name] = True")
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 16:29
Joined
Jan 20, 2009
Messages
12,851
Boolean fields are recorded as True = -1 and False = 0. So a simple Sum of the field will count them. Then apply Abs() to drop the sign.

If you want the proportion of True (as in the thread title) then use the Average (and multiply by 100 for percentage).
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:29
Joined
Jul 9, 2003
Messages
16,278
If your check boxes are laid out on a form then you might find the technique demonstrated in this video useful:-

https://youtu.be/7NJTtqCLhZc

I must apologize for the poor presentation quality of the video. It's one I realize I need to revisit at some stage!

Can't work out how to strike through!!!

The software I use for recording my screen casts "Screencast-O-Matic" (there's a free version) {URL:- https://screencast-o-matic.com/} has recently been upgraded with the ability to edit the audio track easily. I have done a couple of videos demonstrating this new feature. Because of this excellent new feature, I am going through my YouTube videos and when I find one which can be easily shortened, then I am shortening them... this was one.

Sent from my SM-G925F using Tapatalk
 
Last edited:

nick1408

Registered User.
Local time
Today, 16:29
Joined
Jun 16, 2016
Messages
77
Boolean fields are recorded as True = -1 and False = 0. So a simple Sum of the field will count them. Then apply Abs() to drop the sign.

If you want the proportion of True (as in the thread title) then use the Average (and multiply by 100 for percentage).



Pretty much what I did. Thanks guys
 

Users who are viewing this thread

Top Bottom