Option Group Counts

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

    #1

    Option Group Counts

    I can get a total count for a whole option group field, but I need to
    be able to count each individual selection in an option group on a
    report. For example if I had a yes or no option...I would need to know
    how many yes selections there are and how many no selections there are.
    Please help!!

  • fredg

    #2
    Re: Option Group Counts

    On 27 Feb 2006 09:29:33 -0800, El wrote:
    [color=blue]
    > I can get a total count for a whole option group field, but I need to
    > be able to count each individual selection in an option group on a
    > report. For example if I had a yes or no option...I would need to know
    > how many yes selections there are and how many no selections there are.
    > Please help!![/color]

    Is this "Option Group field" a Number datatype or is it really a
    CheckBox Yes/No (Boolean datatype) field?

    If it is a CheckBox Yes/No field then it's values are either -1 (for
    Yes) or 0 (for No).
    In an unbound control on the report:
    For Yes:
    =ABS(Sum([FieldName]))

    For No:
    =Sum([FieldName] + 1)

    If it really is an Option Group then the values are usually 1,2,3 etc.
    =Sum(IIf([FieldName]=1,1,0))
    =Sum(IIf([FieldName] = 2,1,0))
    =Sum(IIf([FieldName] = 3,1,0))
    etc.

    Make sure the name of the control on the report is not the same as the
    name of the [FieldName] in it's control source expression.
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail

    Comment

    • El

      #3
      Re: Option Group Counts

      When I enter =Sum(llf([FieldName]=1,1,0)) it gives me an error and says
      undefined function "llf" in expression. What does this mean? Please
      help!! Thanks!

      Comment

      • fredg

        #4
        Re: Option Group Counts

        On 28 Feb 2006 15:24:33 -0800, El wrote:
        [color=blue]
        > When I enter =Sum(llf([FieldName]=1,1,0)) it gives me an error and says
        > undefined function "llf" in expression. What does this mean? Please
        > help!! Thanks![/color]

        1) Are you absolutely sure you spelled it IIf and not Iff?

        2) Make sure the name of this control is not the same as the name of
        the field used in the expression.

        3) Open any module in Design view (or click Ctrl + G).
        On the Tools menu, click References.
        Click to clear the check box for the type library or object library
        marked as "Missing:."

        An alternative to removing the reference is to restore the referenced
        file to the path specified in the References dialog box. If the
        referenced file is in a new location, clear the "Missing:" reference
        and create a new reference to the file in its new folder.

        See Microsoft KnowledgeBase articles:
        283115 'ACC2002: References That You Must Set When You Work with
        Microsoft Access'
        Or for Access 97:
        175484 'References to Set When Working With Microsoft Access' for
        the correct ones needed,
        and
        160870 'VBA Functions Break in Database with Missing References' for
        how to reset a missing one.

        For even more information, see


        --
        Fred
        Please respond only to this newsgroup.
        I do not reply to personal e-mail

        Comment

        Working...