This MSAccess tutorial explains how to use the Access DSum function with syntax and examples. The Microsoft Access DSum function returns the sum of a set of numeric values from an Access table (or domain).
Thanks. The problem is that I have to calculate about 12 values and am currently already using a DSUM for each which works fine. The reason I was looking to try it with a query was to see if speed the process up.....
You may use Tempvars (temporary Global Variables) to store the value and use it in TextBoxes on Forms, Reports, or in VBA.
Example Syntax: Tempvars.Add VariableName, Value
To display the Value in Variable 'Total' - assuming the value in variable Total= 1000
To use the value in a TextBox on a Form as part of an expression.
="Average: " & Tempvars!Total/DCount("*","QueryName")
To remove a specific variable from memory:
To remove all the Tempvars from memory.
You can assign value to Temporary Variable through Macro Command: SetTempvars "VariableName", Value
You can define several global temporary variables this way and stays valid till you shutdown the database or till you execute individual Remove command or RemoveAll command to remove all the active variables in memory.