Results 1 to 7 of 7
  1. #1
    Join Date
    May 2006
    Posts
    38

    Red face Unanswered: Correct Syntax for Dcount

    I have a query and I am trying to count the number of records in another query matching record in my existing query. I am using the following systax but this is taking me nowhere. Please note that Project No (with a space) is the field name in in the other query.

    Expr1: DCount("[EANo]","qryApproved","[Project No]"="'[ProjectNo]'")

    Could someone help?

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Expr1: DCount("[EANo]","qryApproved","[Project No] = '" & [ProjectNo] & "'")
    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
    May 2006
    Posts
    38
    Many thanks for your help.

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You're welcome
    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

  5. #5
    Join Date
    May 2006
    Posts
    38
    If it is not too much trouble, could you amend the syntax for a numerical value? I tried to change to following but no luck.

    DVRaised: DCount("[Loc No]","qryDV2010C","[Loc No]=[tblProjectsSIB]![LocNo]" & "")

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You really need to practice your expressions!

    DVRaised: DCount("[Loc No]","qryDV2010C","[Loc No] = " & [tblProjectsSIB]![LocNo])

    ST
    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

  7. #7
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Maybe a reference would help you:

    http://www.mvps.org/access/general/gen0018.htm
    Paul

Posting Permissions

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