Results 1 to 4 of 4
  1. #1
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305

    Count number of entries of query in a Report


    Hi, so I've got a fairly specific question that I can't seem to find a solution to online. Basically I want a report to reference how many entries there are in a query. So if the query has 27 entries, I want the report to just show the number "27" somewhere. Any idea how to do that? I found the count function but I'm not sure how to actually input it in a report and have it cite an unrelated query

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You're asking for a record count?
    Rest of my answer removed for now as it is incorrect.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    If your query is called qryMyReport then

    DCount("*","qryMyReport")

    Would give you the answer.
    Assuming the report is opened from a form you could pass that value in using the OpenArgs.
    Alternatively you could add an unbound text box to your Report and simply add the above as it's control source
    = DCount("*","qryMyReport")
    and use that.

    Thirdly you could, in the reports code use a recordsetcount on the report to get the same information.

    Many ways to skin a cat.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #4
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305
    Thank you! That worked!!

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

Similar Threads

  1. Replies: 3
    Last Post: 09-26-2017, 11:19 PM
  2. Replies: 2
    Last Post: 06-30-2016, 06:38 PM
  3. Replies: 5
    Last Post: 05-05-2016, 01:56 PM
  4. Replies: 8
    Last Post: 08-16-2012, 09:04 AM
  5. Replies: 8
    Last Post: 03-14-2012, 05:40 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