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 / Modules / DAO / VBA / March 2007

Tip: Looking for answers? Try searching our database.

DSum Function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 08 Mar 2007 15:26 GMT
I want to use a DSum function to calculate a total of a field in a specific
table.  Each table has a unique name.

I want this to be on a form. (multi record view).  

the syntax would be something like

TotEng = (DSum("[KW]", **tablename**)

where tablename is a field that contains the name of the table that contains
all the KW entries.

see where i'm getting at?
Marshall Barton - 08 Mar 2007 16:25 GMT
>I want to use a DSum function to calculate a total of a field in a specific
>table.  Each table has a unique name.
[quoted text clipped - 7 lines]
>where tablename is a field that contains the name of the table that contains
>all the KW entries.

It looks like you are getting into a lot of trouble.  Table
name should not be variable and your question raises a big
red flag about violations of the rules of ralational
database normalization.

To answer your specific question:
TotEng = DSum("[KW]", <name of field>)

Signature

Marsh
MVP [MS Access]

Mike - 08 Mar 2007 19:18 GMT
believe me, i've heard the "your db is wrong" argument before.  I found no
other viable way than having a table of data for a specific record, and then
using the tablenamefield in subsequent forms/queries/reports.  all this goes
to the fact that the data being entered into the DB is done through a C
program which i have no control over, and works by making a new data table,
and a new main table record entry.

And to respond to your answer:
it didn't work.  do the < and > need to be there or is it just the comma and
the actual name of the field?

> >I want to use a DSum function to calculate a total of a field in a specific
> >table.  Each table has a unique name.
[quoted text clipped - 15 lines]
> To answer your specific question:
> TotEng = DSum("[KW]", <name of field>)
Marshall Barton - 08 Mar 2007 23:01 GMT
Sorry, those were supposed to be square brackets

TotEng = DSum("[KW]", [name of field])

Even those are not needed unless the field name contains a
space or othe funky character.
Signature

Marsh
MVP [MS Access]

>believe me, i've heard the "your db is wrong" argument before.  I found no
>other viable way than having a table of data for a specific record, and then
[quoted text clipped - 26 lines]
>> To answer your specific question:
>> TotEng = DSum("[KW]", <name of field>)
 
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.