Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    11

    Unanswered: How can I get a count from a subreport field?

    Hi,

    How can I get a count from a subreport field?

    Example: I have a subreport (Activity_Subreport) within my main report (Weekly_Activity_Report) and I am trying to count the number of activities for a particular server. The report is grouped by server. I tried modifying the following function, no luck.

    =Count([Activity_Subreport.server])

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    =Count(*) usually works in group headers / footers to tally the number of records in that group.

    HTH
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Apr 2009
    Posts
    11
    Thanks StarTrekker for your response.

    I used the =Count(*) to count the first field (Activity_Server) in my subreport “Activity_Subreport” and the same =Count(*) to count the second field (Activity_Driver) in the same subreport. The count function is not working. It returns incorrect counts.

    I am placing my totals in the “Server Name Footer” section of the main report.

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Count(*) counts the number of records in the group. It is not field specific.

    Counting the first field... what does that mean? Count how many entries there are in that field?? If that is the case, then you might need to try CountA() or you'll need to put calculated expressions in your query for your report to sum.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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