Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

DSum() producing 'strange' results

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon Cleal - 17 Jan 2005 12:17 GMT
Im using Access/Windows 2000

Im trying to use DSum() in the footer of a continuous form I want to sum the
[dblContributionAmount] field when the [dteDateCeased] field is empty to give
me a total of contributions currrently being paid. the form picks up its data
from a table called "staging_tblRegAVC"

I have the following formula in a text box in the form footer
=DSum([dblContributionAmount],"staging_tblRegAVC","[dteDateCeased] is null")

The results I get are 'strange' (for want of a better word) it seems that
access is totalling the [dblContributionAmount] of the first record multiple
times depending on whether [dteDateCeased] is null or not...Im not sure if
that makes sense but maybe the following examples will clarify....

eg#1
[Record No]    [dblContributionAmount]      [dteDateCeased]
     1                           30.00
     2                           20.00
     3                           10.00
DSum() total = 90.00

eg#2
[Record No]    [dblContributionAmount]      [dteDateCeased]
     1                           20.00
     2                           30.00
     3                           10.00
DSum() total = 60.00

eg#3
[Record No]    [dblContributionAmount]      [dteDateCeased]
     1                           10.00                         1/1/2005
     2                           30.00                         1/1/2005
     3                           20.00
DSum() total = 10.00

Thanks in advance for any help anyone can offer
Graeme Richardson - 17 Jan 2005 18:12 GMT
Hi, try enclosing the name of the field that you're summing in quotes.
I'm guessing, but you may have a control on the form or a datasource
containg the field "dblContributionAmount" and that the DSum() functioin is
mapping to it.

=DSum("[dblContributionAmount]","staging_tblRegAVC","[dteDateCeased] is
null")

HTH, Graeme.
Simon Cleal - 19 Jan 2005 09:57 GMT
Thanks Graeme, that worked a treat :)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.