Results 1 to 5 of 5

Thread: DSum Function

  1. #1
    Join Date
    May 2008
    Posts
    48

    Unanswered: DSum Function

    I am having an issue with DSum Function. I am using following expression in report

    =DSum("[Total Input]","Production","[End of Production]"=DateValue([Forms]![MIS]![Text0]))

    but it displays an error like #Name?

    Actually, I want to compute total production i.e. (Total Input) from the table (Production) where criteria i.e. (End of Production) matches with a particular date and date is coming through a Form field (Text0).

    When I run above expression without criteria, it perfectly works. It appears that there is an error with using criteria field.

    Kindly help me in resolving this issue.

    Thanks

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    I can't speak for other users, but I've never been able to make domain functions work in forms and reports. Working in VBA, I have no problem. I have in the past written custom functions to mimic them. The custom function prompts for the same arguments as the domain function, then invokes the domain function and returns whatever the domain function returns.
    It has all the elegance of fitting a square peg into a round hole with a big mallet, but it works.

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    =DSum("[Total Input]","Production","[End of Production] = #" & DateValue([Forms]![MIS]![Text0]) & "#")
    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

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Shoot. I was just going to write what ST wrote. You're too quick ST!
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Whew! Usually it's me that gets pipped
    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

Posting Permissions

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