Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Location
    St. Louis, Missouri, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    'count' function on report (2K)

    Help. I've created a simple database with one table and a couple of queries. I'm using one of the queries to create a report. I cannot for the life of me figure out how to make it do a "count" function on a particular column of the report. I don't want a sum or anything else, just a count. Is there a place I can go to get detailed information on how to do this? Thanks, answer here or at my email address, skelmer@stlcc.edu.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'count' function on report (2K)

    In the appropriate report section (probably the report footer), place an unbound textbox with the following formula in the Control Source: =Count([your fieldname])

  3. #3
    New Lounger
    Join Date
    Sep 2002
    Location
    St. Louis, Missouri, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'count' function on report (2K)

    Well, I'm closer...now I get #error on the report instead of a blank space! I want it to count that field, but currently there is only one item in that field (from the query). I should still see something besides #error, right?

  4. #4
    Star Lounger
    Join Date
    Oct 2001
    Location
    Western Massachusetts, USA
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'count' function on report (2K)

    Getting a Count in a Report can be a daunting task. The simple solution (if the information cooperates) is to put the following in a textbox in your Report Footer ( or whichever footer is appropriate)

    =Sum(IIf([YourFieldOnTheReport] = "WhateverValueYouWantToCount", 1,0))

    Summing zero's and 1's is the same as counting.

    Paul

  5. #5
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: 'count' function on report (2K)

    Is there any chance that the field you are counting on contains a null value?
    Regards,

    Gary
    (It's been a while!)

  6. #6
    New Lounger
    Join Date
    Sep 2002
    Location
    St. Louis, Missouri, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'count' function on report (2K)

    The field is not "null," I don't think. It's a text field, I just want a count of the column. If there's four, I want it to say four, if there's 15, I want it to say 15. I'm trying to create a report that anyone, whether they know access or not, can print off whenever they want, and it will have an accurate count of how many entries are in that column.

  7. #7
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'count' function on report (2K)

    I would think that the result would be 1. Is your fieldname and the report textbox name exactly the same? If not, try using the name of the report textbox in the Contol Source formula I posted earlier. Does that help?

  8. #8
    New Lounger
    Join Date
    Sep 2002
    Location
    St. Louis, Missouri, USA
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: 'count' function on report (2K)

    It works in the body of the report but not in the footer, but that solves my problem easily enough. THanks for your help!

Posting Permissions

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