473,405 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Why I am getting error with sum function.

222 100+
Dear Sir,


I have a continuous form base on union of 2 queries.

A field date called [dates] and another textbox called receipt_sum

the source of the receipt_sum is
Expand|Select|Wrap|Line Numbers
  1.  =nz(DSum("total","table_mov","[date]=[dates]" & " And" & "[free]=false" & " and" & "[save]=true"),0) 
on the footer of the my form I am trying to assign another textbox with the source below:

Expand|Select|Wrap|Line Numbers
  1.  =sum([receipt_sum])
An error is always occurred the caption of my textbox on the footer is always [#error]

NB: I am sure about the name of the field.

any idea plz


thank you in advance.


WASSIM S DACCACHE
Jun 6 '08 #1
5 1786
ADezii
8,834 Expert 8TB
I'm not sure that it will actually work, but I do know your syntax is incorrect. You must include the entire expression in the Footer Summation for [receipt_sum], you cannot simply refer to the Field containing the expression, as in:
Expand|Select|Wrap|Line Numbers
  1. =Sum(nz(DSum("total","table_mov","[date]=[dates]" & " And" & "[free]=false" & " and" & "[save]=true"),0))
Jun 6 '08 #2
missinglinq
3,532 Expert 2GB
I think that's exactly right. You cannot simply run a function like Sum() on a control that holds a calculated value, you have to run it on the expression used for the calculation.

Linq ;0)>
Jun 7 '08 #3
wassimdaccache
222 100+
I'm not sure that it will actually work, but I do know your syntax is incorrect. You must include the entire expression in the Footer Summation for [receipt_sum], you cannot simply refer to the Field containing the expression, as in:
Expand|Select|Wrap|Line Numbers
  1. =Sum(nz(DSum("total","table_mov","[date]=[dates]" & " And" & "[free]=false" & " and" & "[save]=true"),0))
Thank you for your quick reply. I acknowledge that it is working well.


But actually I am a little bit confused with the function dsum.

Does dsum function go to the table and do the sum base on the criteria set on the expression or it does the sum of the form criteria + criteria on the expression. ?


Any suggestion would be appreciated.


Thank you in advanced.

WASSIM S DACCACHE
CCE
Jun 7 '08 #4
ADezii
8,834 Expert 8TB
Thank you for your quick reply. I acknowledge that it is working well.


But actually I am a little bit confused with the function dsum.

Does dsum function go to the table and do the sum base on the criteria set on the expression or it does the sum of the form criteria + criteria on the expression. ?


Any suggestion would be appreciated.


Thank you in advanced.

WASSIM S DACCACHE
CCE
DSum() calculates the SUM of a set of values in a specified set of Records called a Domain. Criteria can be set based on Fields contained within the Domain. The summation will be done on the [total] Field of the table_mov Table, based on your criteria.
Jun 7 '08 #5
NeoPa
32,556 Expert Mod 16PB
Wassim, You need to make the Help system your friend.

Try this :
  1. Open Access.
  2. Use Alt-F11 to switch to the VBA window.
  3. Use Ctrl-G to go to the Immediate pane.
  4. Type DSum.
  5. Press F1.
This will find the Help page associated with this function and this has a lot of information that will help you understand it more fully. It explains all the arguments in detail.

This is called Context-Sensitive Help, and is a very useful thing to know and use.
Jun 12 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: ItsMe | last post by:
Hi Guyz, I'm unable to understand this (AddressOf) error??? In VB6 I have two functions: ---------------------------- Public Function ImageFirstImageCallback(ByVal hWnd As Integer, ByVal...
32
by: paul | last post by:
HI! I keep on getting this error and I have tried different things but I am not sure how to send the expiring date. The error that I am getting in Firefox 1.5 is "Error: expires.toGMTString is...
1
by: Abhishek | last post by:
Hello All I am able to call the function exported by Exe from a dll file im getting the address of the function but whille calling that function im getting access violation Error as bellow my code...
1
by: sshankar | last post by:
Hi, New to Stored procedure. Basically just installed DB2 v8.1.0.36 Was trying to build a stored procedure.. It is giving following error.. Looks like some error related to configuration...
8
by: ipy2006 | last post by:
In my HTML I have, <input type="button" class="cartonsumkey" value="Sum Cartons" onclick="sumup(this);" /> In an external file that is called in Head area, I have, function sumup( o ) { ...
41
by: Jim | last post by:
Hi guys, I have an object which represents an "item" in a CMS "component" where an "item" in the most basic form just a field, and a "component" is effectively a table. "item" objects can be...
10
by: Rahul Babbar | last post by:
Hi, I am getting the following error, while executing the simple insert script on a few tables. INSERT INTO <table_name>(<col1>) VALUES (1); DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884,...
3
by: jominp | last post by:
When i am trying to execute,the following query using hibernate select * from from user where (date(MONTH || '-' || '01'|| '-' || YEAR) between '2005-01-01' and '2009-01-01') I am getting the...
21
vikas251074
by: vikas251074 | last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support...
5
by: tshad | last post by:
I have the following class in my VS 2008 project that has a namespace of MyFunctions. ********************************* Imports System Imports System.Text.RegularExpressions Namespace...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.