473,473 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

form sum calculation error

Hello all,

I have identical design for form and report but I am getting
calculation error on form and everything is OK on report. The form and
report are build up on SQL statement. The calculation is very simple.
The calculation is done in an underling query if I can call it a query
or I should call it a SQL statement. It looks like a query but it is
not saved as the query. The calculation in that query is very simple -
ExtendedPrice:[Price]*[QTY]. Then I have a field as follows:
=Sum([ExtendedPrice]) and it is OK on report but it returns error on
form. The funny think that when I tried differnt expression and
approaches this expression returns number after a change. But as soon
as form is saved and opened again it displays Error. Any idea that I
have wrong?

Jul 14 '06 #1
4 3742
vg*****@telus.net wrote:
Hello all,

I have identical design for form and report but I am getting
calculation error on form and everything is OK on report. The form and
report are build up on SQL statement. The calculation is very simple.
The calculation is done in an underling query if I can call it a query
or I should call it a SQL statement. It looks like a query but it is
not saved as the query. The calculation in that query is very simple -
ExtendedPrice:[Price]*[QTY]. Then I have a field as follows:
=Sum([ExtendedPrice]) and it is OK on report but it returns error on
form. The funny think that when I tried differnt expression and
approaches this expression returns number after a change. But as soon
as form is saved and opened again it displays Error. Any idea that I
have wrong?
What happens if you enter Sum([Price]*[QTY]) in the form instead?
Jul 14 '06 #2
check the form's recordsource property. You need to bind your form to
the table or query that contains the field ExtendedPrice. Make that
table or query the recordsource for the form. In order to use this kind
of expression on a textbox on a form, the form must have a corresponding
recorsource to pull the data from. Then place the expression

=Sum([ExtendedPrice])

in the ControlSource of an unbound textbox. That should fix your
problem.
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jul 14 '06 #3
I tried to bound calculated field and I tried to do calculation like
that. In both cases I have Error. But when I open form and do first
time changes for example from =Sum([Price]*[QTY]) to
=Sum([ExtendedPrice]) I am getting results. As soon as form saved and
opened again the Error is coming back. I wonder if some of the form
property effects it. With formulas I am Ok as the same formulas are
used in invoice report and report works well. Is there something in
calculation that you can do in report but you can not do in form?
Thanks/ Vadim
salad wrote:
vg*****@telus.net wrote:
Hello all,

I have identical design for form and report but I am getting
calculation error on form and everything is OK on report. The form and
report are build up on SQL statement. The calculation is very simple.
The calculation is done in an underling query if I can call it a query
or I should call it a SQL statement. It looks like a query but it is
not saved as the query. The calculation in that query is very simple -
ExtendedPrice:[Price]*[QTY]. Then I have a field as follows:
=Sum([ExtendedPrice]) and it is OK on report but it returns error on
form. The funny think that when I tried differnt expression and
approaches this expression returns number after a change. But as soon
as form is saved and opened again it displays Error. Any idea that I
have wrong?
What happens if you enter Sum([Price]*[QTY]) in the form instead?
Jul 15 '06 #4
Try an experiment. Create a new form just with one text box and all the
properties of the form are default properties. Set the recordsource of
that form to the table/query that has the data you need to calculate.
In the textbox enter your calculated expression

=Sum([ExtendedPrice])
Open the form and see if that works. Then save the new form and re-open
it to see if it still works. If it works then you can start modifying
the form to your needs. Each time you make a change to the form - open
the form to see if it still works. After a change, if you get an Error
message in the textbox, then make a note of the change you made after
you receive the Error message in the textbox. That change is what is
causing your problem. Then, if you can't figure out what the problem
is, you can post the change that you made after you receive the Error
message.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jul 16 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Newbie | last post by:
OK, this may be impossible since I'm using 3rd party shopping cart ASP software, but I've been able to finagle a lot of other stuff I thought wouldn't work, so here we go: I'm using a form in...
3
by: Pat | last post by:
Hello, I've used Sum() to total bound fields on a continuous form with no problem. However, I now have a continuous form, on which I use an unbound field to calculate the number of hours between...
1
by: Yuki | last post by:
Thanks for taking the time to look at my problem. I keep getting a #Name error from a calculated field on a form. It is a text box field unbound. The calculation is very very simple yet I still...
2
by: Del | last post by:
Thanks in advance for any help. I have a database that was created in Access 2000. Several users have been upgraded to Access 2003. Since upgrading to 2003 we have noticed that some of the...
1
by: Paolo | last post by:
Hello, I have a form based on a query that has four fields (a, b, c and d). The query get's its data from a table. The last field of my form is a calculated field (b*c/d). The field d is not in...
2
by: DebbieG | last post by:
I have no idea how to start with this one. I have a subform where records could look similar to: Infraction Date Points 01/01/2000 3 06/01/2002 1 Somehow, I've got to...
2
by: semutmerah | last post by:
hi.. my english maybe wrong.. but hope somebody can understand me :) I did created 3 forms. "MainForm" , "CalForm" , "WaitForm". On "MainForm", I did put a command button called "Run". ...
2
by: campos | last post by:
Hi all, I ran into a headache problem. I have a windows form with a progress bar on it. Then I new a thread to do calculation for a long time. I want the progress bar to show the calculation...
12
by: GLEberts | last post by:
I made an addition to a form I was using and it threw a wrench into the works for my ability to adjust the calculation. I am trying to sum a unbound control calculation in a continous form. ...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.