Results 1 to 4 of 4
  1. #1
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141

    Should be simple DSUM - I get #error

    1. I know the value in the query is not blank


    2. Assume the names are correct

    I have
    Code:
    =DSum("[SumOfRepRevenue]","QuryCOMMRepDealsM1Mgr","[LastOfClassification]=6")
    I have tried using bracket on the Domain also...
    In the query there is one line with LastOfClassification = 6 the SumOfRepRevenue = 14000
    the DSum returns #Error in the Text box.

    Don't know what I am missing...

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    The error might not be in the Dsum.

    Where are you using the expression, i.e. in what property of the text box?

    Did you try the DSUM in the immediate window (Ctrl-G) to see if it is returning the correct value?

    Is the table field that is behind the query field [LastofClassification] (I assume it is [Classification]) numeric or text type?

  3. #3
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    Quote Originally Posted by crimedog View Post
    Code:
    =DSum("[SumOfRepRevenue]","QuryCOMMRepDealsM1Mgr","[LastOfClassification]=6")
    if [LastOfClassification] is text
    DSum("[SumOfRepRevenue]","QuryCOMMRepDealsM1Mgr","[LastOfClassification]='6'"
    if numeric
    DSum("[SumOfRepRevenue]","QuryCOMMRepDealsM1Mgr","[LastOfClassification]=" & 6
    I also don't think you should be using the "=" which is used in Excel, but can't remember a place it's used in Access.

  4. #4
    crimedog is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    141
    You guys were right - the table had it in Text - so surrounding it with single quote fixed it.

    Thanks!

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

Similar Threads

  1. Replies: 4
    Last Post: 05-25-2014, 02:01 AM
  2. Dsum invalid bracketing error
    By MaryRod in forum Queries
    Replies: 11
    Last Post: 03-27-2014, 06:26 PM
  3. Dsum, Syntax error
    By mike02 in forum Queries
    Replies: 5
    Last Post: 05-24-2013, 09:52 AM
  4. DSum Error
    By alsoto in forum Queries
    Replies: 4
    Last Post: 11-21-2011, 10:47 AM
  5. DSUM() Error
    By msr71 in forum Access
    Replies: 14
    Last Post: 09-25-2011, 06:39 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