Results 1 to 4 of 4
  1. #1
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215

    Generating A Count In A Report

    Hi,



    I have a Query that is not associated with a particular report that I am running. However, all I want to do on the report is display the count of that particular query. I can not seem to do this without receiving an error message.

    Does anyone know how to do this?


    My second option is to create a subreport that has this query built into it. The count shows up in this subreport. However, the field in which I am displaying the count in gets generated however many records there are in that query, when I just want it to show up once.

    Any help is appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Put that field in subreport header or footer section. If you don't want detail records then don't put controls in detail section or set it as not visible.

    Or use domain aggregate function expression in textbox on primary report and eliminate subreport.

    =DLookup("fieldname", "table or query name")

    or

    =DCount("*", "table or query name")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    McArthurGDM is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    215
    Thank you, that DCount function worked. I didn't think to use that. I think the Count function itself must be dependent on a reports underlying table/query.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    That is correct.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Generating Report from Form filtering
    By oica72 in forum Reports
    Replies: 5
    Last Post: 12-17-2011, 05:35 PM
  2. Replies: 6
    Last Post: 08-22-2011, 06:52 PM
  3. Help on Generating a Report!
    By ETCallHome in forum Reports
    Replies: 10
    Last Post: 06-22-2011, 01:08 PM
  4. Generating Report from Form
    By mwabbe in forum Reports
    Replies: 8
    Last Post: 08-30-2010, 12:25 PM
  5. noob prob, generating next report
    By flash319 in forum Reports
    Replies: 2
    Last Post: 08-04-2008, 03:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums