Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Ohio - USA, Ohio, USA
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Counting True Values (Access XP SP3)

    Here's something I've never tried before that has me stumped. I set up a database to track the various responses to questionnaires and invitations we are sending to our former classmates in preparation for a class reunion. Many of the fields are Yes/No fields, and I would like to count just the Yes responses (or sometimes just the No responses) in various fields and have the total number appear just on the reports. So, for example, Responded to Questionnaire - Y/N; or Intends to Attend-Y/N. My thought was using something like =IIf([Responded to Questionnaire]="True",Count([qry50th]![Responded to Questionnaire])). However, that does not work at all; in fact, although I don't get an error message, it doesn't give me any response at all.

    Help would be appreciated.

    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Counting True Values (Access XP SP3)

    Place a text box in the report footer, and set its Control Source to

    =Abs(Sum([Responded to Questionnaire]))

    Similar for other fields.

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Ohio - USA, Ohio, USA
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Counting True Values (Access XP SP3)

    Thanks so much Hans. I had never seen that before but it's exactly what I needed.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Counting True Values (Access XP SP3)

    It works because True/Yes = -1 and False/No = 0. Sum adds -1 for each Yes, and Abs removes the -.

Posting Permissions

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