455,487 Members | 1,801 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,487 IT Pros & Developers. It's quick & easy.

# count a check box field?

 P: n/a hi, how would u do a count for somthing that is checked, in a check box?? this is wat i've got so far, but its coming out with an error; =DCount("Available","tblFilm","[Available]='Checked'") i;ve tried changed checked to true, but its the same error. i'm trying to get it to count the number of checks in the boxes. dev Feb 17 '06 #1
7 Replies

 P: n/a Hi: Since "checked"=true=-1, just sum the field, then take the absolute value: =abs(sum([available]) If you're doing it in a report, the above will suffice if used in a grouped section or report footer. If in a query I guess you could use dsum() HTH Jan DP wrote: hi, how would u do a count for somthing that is checked, in a check box?? this is wat i've got so far, but its coming out with an error; =DCount("Available","tblFilm","[Available]='Checked'") i;ve tried changed checked to true, but its the same error. i'm trying to get it to count the number of checks in the boxes. dev Feb 17 '06 #2

 P: n/a sorry, so wat would it be, ; =abs(sum([Available],"tblFilm") i tried the above, it dont work. i've just got it on a statistics form. i'm tryin to count teh number of checks. dev "Jan" wrote in message news:11*************@corp.supernews.com... Hi: Since "checked"=true=-1, just sum the field, then take the absolute value: =abs(sum([available]) If you're doing it in a report, the above will suffice if used in a grouped section or report footer. If in a query I guess you could use dsum() HTH Jan DP wrote: hi, how would u do a count for somthing that is checked, in a check box?? this is wat i've got so far, but its coming out with an error; =DCount("Available","tblFilm","[Available]='Checked'") i;ve tried changed checked to true, but its the same error. i'm trying to get it to count the number of checks in the boxes. dev Feb 17 '06 #3

 P: n/a Hello DP, Perhaps another way around your problem is to create an extra field in your query such as SumYes: IIf([Available]=-1,1,0) Then, Sum([SumYes]) would be the final expression. This would sum all of the 1's in that column. Hope you understand what I'm saying. I use this method all the time. If put on a form, place Sum([SumYes]) in the footer for your form to show your total. Regards Feb 17 '06 #4

 P: n/a sorry, that seems too complicated. i was thinking of just using the expression builder, like the person before suggested. i have a statistics form, where i wanted the user, to see how many films are available and how many arent. i've got other fields, which are very similar, and i just wanted a quick and easy method of doing it. i've not got a query to process any of teh above, its just a form, created from a customer table. ive got; =abs(sum([Available],"tblFilm") so far, and it aint workin. is there anything similar to that i can use? thanx dev "inkman04" wrote in message news:11*********************@g43g2000cwa.googlegro ups.com... Hello DP, Perhaps another way around your problem is to create an extra field in your query such as SumYes: IIf([Available]=-1,1,0) Then, Sum([SumYes]) would be the final expression. This would sum all of the 1's in that column. Hope you understand what I'm saying. I use this method all the time. If put on a form, place Sum([SumYes]) in the footer for your form to show your total. Regards Feb 18 '06 #5

 P: n/a sorry,. i done it now. it was =Abs(DSum("Available","tblFilm")) but how would i count them, if they are not checked? dev "DP" wrote in message news:uc******************@newsfe6-gui.ntli.net... sorry, that seems too complicated. i was thinking of just using the expression builder, like the person before suggested. i have a statistics form, where i wanted the user, to see how many films are available and how many arent. i've got other fields, which are very similar, and i just wanted a quick and easy method of doing it. i've not got a query to process any of teh above, its just a form, created from a customer table. ive got; =abs(sum([Available],"tblFilm") so far, and it aint workin. is there anything similar to that i can use? thanx dev "inkman04" wrote in message news:11*********************@g43g2000cwa.googlegro ups.com... Hello DP, Perhaps another way around your problem is to create an extra field in your query such as SumYes: IIf([Available]=-1,1,0) Then, Sum([SumYes]) would be the final expression. This would sum all of the 1's in that column. Hope you understand what I'm saying. I use this method all the time. If put on a form, place Sum([SumYes]) in the footer for your form to show your total. Regards Feb 18 '06 #6

 P: n/a That would be (the total recordcount) - (the abs(dSum...)) "DP" wrote in message news:eo******************@newsfe5-gui.ntli.net... sorry,. i done it now. it was =Abs(DSum("Available","tblFilm")) but how would i count them, if they are not checked? dev "DP" wrote in message news:uc******************@newsfe6-gui.ntli.net... sorry, that seems too complicated. i was thinking of just using the expression builder, like the person before suggested. i have a statistics form, where i wanted the user, to see how many films are available and how many arent. i've got other fields, which are very similar, and i just wanted a quick and easy method of doing it. i've not got a query to process any of teh above, its just a form, created from a customer table. ive got; =abs(sum([Available],"tblFilm") so far, and it aint workin. is there anything similar to that i can use? thanx dev "inkman04" wrote in message news:11*********************@g43g2000cwa.googlegro ups.com... > Hello DP, > > Perhaps another way around your problem is > to create an extra field in your query such as > > SumYes: IIf([Available]=-1,1,0) > > Then, Sum([SumYes]) would be the final > expression. This would sum all of the 1's > in that column. Hope you understand what > I'm saying. I use this method all the time. > > If put on a form, place Sum([SumYes]) in > the footer for your form to show your total. > > Regards > Feb 19 '06 #7

 P: n/a thanx man, i done it. dev "Mal" wrote in message news:47***************@newsread1.news.atl.earthlin k.net... That would be (the total recordcount) - (the abs(dSum...)) "DP" wrote in message news:eo******************@newsfe5-gui.ntli.net... sorry,. i done it now. it was =Abs(DSum("Available","tblFilm")) but how would i count them, if they are not checked? dev "DP" wrote in message news:uc******************@newsfe6-gui.ntli.net... sorry, that seems too complicated. i was thinking of just using the expression builder, like the person before suggested. i have a statistics form, where i wanted the user, to see how many films are available and how many arent. i've got other fields, which are very similar, and i just wanted a quick and easy method of doing it. i've not got a query to process any of teh above, its just a form, created from a customer table. ive got; =abs(sum([Available],"tblFilm") so far, and it aint workin. is there anything similar to that i can use? thanx dev "inkman04" wrote in message news:11*********************@g43g2000cwa.googlegro ups.com... > Hello DP, > > Perhaps another way around your problem is > to create an extra field in your query such as > > SumYes: IIf([Available]=-1,1,0) > > Then, Sum([SumYes]) would be the final > expression. This would sum all of the 1's > in that column. Hope you understand what > I'm saying. I use this method all the time. > > If put on a form, place Sum([SumYes]) in > the footer for your form to show your total. > > Regards > Feb 19 '06 #8

### This discussion thread is closed

Replies have been disabled for this discussion.