Home > Archive > MS Access database support > February 2006 > count a check box field?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author count a check box field?
DP

2006-02-17, 11:24 am

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","& #91;Available]='Chec
ked'")

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



Jan

2006-02-17, 11:24 am

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","& #91;Available]='Chec
ked'")
>
> 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
>
>
>

DP

2006-02-17, 1:24 pm

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" < jan@stempelconsultin
g.com> wrote in message
news:11vc0jiduqomsb5
@corp.supernews.com...[color=darkred]
> 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:


inkman04

2006-02-17, 1:24 pm

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

DP

2006-02-18, 1:24 pm

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" <raycait04@yahoo.com> wrote in message
news:1140199580.475808.40590@g43g2000cwa.googlegroups.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
>



DP

2006-02-18, 1:24 pm

sorry,. i done it now. it was

=Abs(DSum("Available","tblFilm"))

but how would i count them, if they are not checked?

dev

"DP" <DP@hotmail.com> wrote in message
news:ucJJf.30973$i2.14022@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" <raycait04@yahoo.com> wrote in message
> news:1140199580.475808.40590@g43g2000cwa.googlegroups.com...
>
>



Mal

2006-02-19, 3:24 am

That would be (the total recordcount) - (the abs(dSum...))




"DP" <DP@hotmail.com> wrote in message
news:eoJJf.23563$m13.2214@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" <DP@hotmail.com> wrote in message
> news:ucJJf.30973$i2.14022@newsfe6-gui.ntli.net...
> before
> are
> and
>
>



DP

2006-02-19, 7:23 am

thanx man, i done it.

dev

"Mal" <me@myhome.net> wrote in message
news:47RJf.197$S25.136@newsread1.news.atl.earthlink.net...
> That would be (the total recordcount) - (the abs(dSum...))
>
>
>
>
> "DP" <DP@hotmail.com> wrote in message
> news:eoJJf.23563$m13.2214@newsfe5-gui.ntli.net...
films[color=darkred]

quick[color=darkred]

use?[color=darkred]
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com