Results 1 to 7 of 7
  1. #1
    lmp101010 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2009
    Posts
    10

    count query

    I have the following query:



    SELECT [CSR List 2].[Last Name], [CSR List 2].[First Name], [CSR List 2].[Active CSR]
    FROM [CSR List 2]
    WHERE ([CSR List 2].[Active CSR]="Yes");

    This is working but I would like to add a column which counts the total results. Any help?

  2. #2
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    Do you mean the total results within that query? You can create an unbound text box with a DCount Function e.g. DCount("*","MyQuery")

  3. #3
    lmp101010 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2009
    Posts
    10

    count query

    Thanks for you help! Can you tell me how to create and unbound text box?

  4. #4
    Datagopherdan is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Dec 2008
    Posts
    220
    You just select textbox from the controlbox. That's all there is to it.

    Quote Originally Posted by lmp101010 View Post
    Thanks for you help! Can you tell me how to create and unbound text box?

  5. #5
    lmp101010 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2009
    Posts
    10

    count query

    Thanks for your help. I attempted your instructions by adding a calculated text box to the form. Then I put in the function that you recommended DCount("*","MyQuery"). I got a pop up asking me to enter a parameter value. I assumed the "My Query" was just a placeholder and changed it to "Current CS Member" which is the value that I want to count. (In other words I have a long list of "Current CS Members" and I am trying to count them). I still received the same "enter parameter value" error. Any clues what I'm doing wrong. Thanks again for your help!

  6. #6
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    "My Query" should be your SQL Statement. If you've saved your Query as a Query Object in Access, you can use that name as well: For example. . .

    You have a query called qryMySelect
    Code:
    SELECT [CSR List 2].[Last Name], [CSR List 2].[First Name], [CSR List 2].[Active CSR]
    FROM [CSR List 2]
    WHERE ([CSR List 2].[Active CSR]="Yes");
    You would use
    Code:
    =DCount("*","qryMySelect")

  7. #7
    lmp101010 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2009
    Posts
    10

    count query

    That works. Thanks!

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

Similar Threads

  1. Multiple count query
    By aajay05 in forum Queries
    Replies: 2
    Last Post: 03-08-2010, 10:00 AM
  2. Count function on query
    By yousillygoose in forum Queries
    Replies: 1
    Last Post: 02-15-2010, 09:58 PM
  3. Running Count Query
    By monkey2003 in forum Queries
    Replies: 0
    Last Post: 09-21-2009, 12:24 PM
  4. Result of Count Query not known elsewhere
    By Carole in forum Access
    Replies: 1
    Last Post: 09-07-2008, 09:39 AM
  5. Query using count function
    By wasim_sono in forum Queries
    Replies: 0
    Last Post: 11-28-2007, 03:16 AM

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