count a check box field?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DP

    #1

    count a check box field?

    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("Availa ble","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



  • Jan

    #2
    Re: count a check box field?

    Hi:

    Since "checked"=t rue=-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:[color=blue]
    > 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("Availa ble","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
    >
    >
    >[/color]

    Comment

    • DP

      #3
      Re: count a check box field?

      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@stempelcon sulting.com> wrote in message
      news:11vc0jiduq omsb5@corp.supe rnews.com...[color=blue]
      > Hi:
      >
      > Since "checked"=t rue=-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:[color=green]
      > > 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("Availa ble","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
      > >
      > >
      > >[/color][/color]


      Comment

      • inkman04

        #4
        Re: count a check box field?

        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

        Comment

        • DP

          #5
          Re: count a check box field?

          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@yaho o.com> wrote in message
          news:1140199580 .475808.40590@g 43g2000cwa.goog legroups.com...[color=blue]
          > 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
          >[/color]


          Comment

          • DP

            #6
            Re: count a check box field?

            sorry,. i done it now. it was

            =Abs(DSum("Avai lable","tblFilm "))

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

            dev

            "DP" <DP@hotmail.com > wrote in message
            news:ucJJf.3097 3$i2.14022@news fe6-gui.ntli.net...[color=blue]
            > sorry, that seems too complicated.
            > i was thinking of just using the expression builder, like the person[/color]
            before[color=blue]
            > suggested.
            >
            > i have a statistics form, where i wanted the user, to see how many films[/color]
            are[color=blue]
            > available and how many arent.
            > i've got other fields, which are very similar, and i just wanted a quick[/color]
            and[color=blue]
            > 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@yaho o.com> wrote in message
            > news:1140199580 .475808.40590@g 43g2000cwa.goog legroups.com...[color=green]
            > > 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
            > >[/color]
            >
            >[/color]


            Comment

            • Mal

              #7
              Re: count a check box field?

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




              "DP" <DP@hotmail.com > wrote in message
              news:eoJJf.2356 3$m13.2214@news fe5-gui.ntli.net...[color=blue]
              > sorry,. i done it now. it was
              >
              > =Abs(DSum("Avai lable","tblFilm "))
              >
              > but how would i count them, if they are not checked?
              >
              > dev
              >
              > "DP" <DP@hotmail.com > wrote in message
              > news:ucJJf.3097 3$i2.14022@news fe6-gui.ntli.net...[color=green]
              >> sorry, that seems too complicated.
              >> i was thinking of just using the expression builder, like the person[/color]
              > before[color=green]
              >> suggested.
              >>
              >> i have a statistics form, where i wanted the user, to see how many films[/color]
              > are[color=green]
              >> available and how many arent.
              >> i've got other fields, which are very similar, and i just wanted a quick[/color]
              > and[color=green]
              >> 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@yaho o.com> wrote in message
              >> news:1140199580 .475808.40590@g 43g2000cwa.goog legroups.com...[color=darkred]
              >> > 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
              >> >[/color]
              >>
              >>[/color]
              >
              >[/color]


              Comment

              • DP

                #8
                Re: count a check box field?

                thanx man, i done it.

                dev

                "Mal" <me@myhome.ne t> wrote in message
                news:47RJf.197$ S25.136@newsrea d1.news.atl.ear thlink.net...[color=blue]
                > That would be (the total recordcount) - (the abs(dSum...))
                >
                >
                >
                >
                > "DP" <DP@hotmail.com > wrote in message
                > news:eoJJf.2356 3$m13.2214@news fe5-gui.ntli.net...[color=green]
                > > sorry,. i done it now. it was
                > >
                > > =Abs(DSum("Avai lable","tblFilm "))
                > >
                > > but how would i count them, if they are not checked?
                > >
                > > dev
                > >
                > > "DP" <DP@hotmail.com > wrote in message
                > > news:ucJJf.3097 3$i2.14022@news fe6-gui.ntli.net...[color=darkred]
                > >> sorry, that seems too complicated.
                > >> i was thinking of just using the expression builder, like the person[/color]
                > > before[color=darkred]
                > >> suggested.
                > >>
                > >> i have a statistics form, where i wanted the user, to see how many[/color][/color][/color]
                films[color=blue][color=green]
                > > are[color=darkred]
                > >> available and how many arent.
                > >> i've got other fields, which are very similar, and i just wanted a[/color][/color][/color]
                quick[color=blue][color=green]
                > > and[color=darkred]
                > >> 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[/color][/color][/color]
                use?[color=blue][color=green][color=darkred]
                > >>
                > >>
                > >> thanx
                > >>
                > >> dev
                > >>
                > >> "inkman04" <raycait04@yaho o.com> wrote in message
                > >> news:1140199580 .475808.40590@g 43g2000cwa.goog legroups.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
                > >> >
                > >>
                > >>[/color]
                > >
                > >[/color]
                >
                >[/color]


                Comment

                Working...