Results 1 to 5 of 5

Thread: Access (97)

  1. #1
    New Lounger
    Join Date
    Apr 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access (97)

    Help... I am trying to create a report that includes a function that will count checked boxes. What is the proper syntax for doing so? I only want to count those boxes that are checked. Is there a way to do a count If true? Or am I out of luck?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Access (97)

    I presume that you have a query that is the source of the report. If so, then all you need in the query is an iif as follows:
    iif(CheckboxControl,1,0) as CountCheckbox
    In your report footer, you need a control that sums this query control, just put the following in the controls source:
    =sum(CountCheckbox)
    This may not be exactly what you want, but I hope it gives you an idea.
    HTH
    Pat

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

    Re: Access (97)

    Or even easier than the previous solution by patt:
    In a Boolean field, False = 0 and True = -1.
    So you can put a text box in the report footer with control source
    =-Sum([Fieldname])
    where Fieldname is the name of the field behind the checkboxes.

  4. #4
    New Lounger
    Join Date
    Apr 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access (97)

    Thank you for your suggestion. I'll give it a try.

    Linda

  5. #5
    New Lounger
    Join Date
    Apr 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access (97)

    Thanks for your suggestions. I'll give it a try.

    Linda

Posting Permissions

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