Results 1 to 5 of 5
  1. #1
    Nixx1401 is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Feb 2010
    Location
    Barbados
    Posts
    115

    count the number of records from a query


    I created a query which displays the persons currently on vacation leave I would like to count the number of persons on vacation.

    The fields being used are Date From, Date To, Name, Type Leave

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,712
    In what situation? One way would be a DCount() on the query:

    DCount("*", "QueryName")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Nixx1401

    You could try...

    dim x as Integer
    x= DCount("*","yourqueryname")
    'MsgBox x

    Hope this helps.

    Jim

  4. #4
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Sorry...

    I didn't see Paul's reply before I posted in a duplicate fashion.

    Jim

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,712
    No problem Jim.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 11
    Last Post: 12-09-2010, 10:55 PM
  2. Query to count records
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 10-24-2010, 09:24 AM
  3. Replies: 3
    Last Post: 08-26-2010, 02:11 PM
  4. Count distinct records in parameterized query
    By SilverSN95 in forum Access
    Replies: 5
    Last Post: 07-27-2010, 09:31 AM
  5. Replies: 7
    Last Post: 07-22-2010, 01:14 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 - Senior Forums