Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Location
    Madison, Wisconsin, USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access (97 /SR-1)

    When creating a report I need to be able to get a total of yes/no boxes that have been checked per item. (such as RFP's)
    In the group header on the report I tried putting ="total for |[RFP]|:" but it just prints out Total for RFP0: instead of adding the number of checks for that field. Is it possible to add up check boxes and if so what is the expression needed to make this happen?

  2. #2
    New Lounger
    Join Date
    Apr 2002
    Location
    Columbus, Ohio, USA
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access (97 /SR-1)

    Hello: Maybe these will help:

    You can use the following expressions in a report footer to count the occurrences of Yes, No, or Null in a field named YesNoField with a data type of Yes/No:
    Expression Sums What
    --------------------------------------------
    =Sum(IIF([YesNoField],1,0)) Yes
    =Sum(IIF([YesNoField],0,1)) No
    =Sum(IIF(Not[YesNoField],1,0)) No
    =Sum(IIF(IsNull[YesNoField],1,0)) Null
    You can also create a related expression to count a specific value in a field. For example, the following sample expression counts all occurrences of the value 3 in a field called MyField.
    =Sum(IIF([MyField]=3,1,0))

    From the Microsoft Knowledge Base site, Keywords count yes/no

  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Access (97 /SR-1)

    Since in Access VBA "True" = -1 and "False" = 0, you can count checked (true) checkboxes by using expression in textbox in report footer such as:
    <pre>=-(Sum([CHECK]))</pre>

    Or
    <pre>=Abs((Sum([CHECK])))</pre>


    Where CHECK is name of Yes/No (checkbox) field.

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •