473,394 Members | 1,916 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,394 software developers and data experts.

Sum to be able to be viewed on a Report!

I have a text box [txttotalmatcost] with the following in the control source

=CDbl(nz([txtmatcost1],0))+CDbl(nz([txtmatcost2],0))+CDbl(nz([txtmatcost3],0))+CDbl(nz([txtmatcost4],0))+CDbl(nz([txtmatcost5],0))+CDbl(nz([txtmatcost6],0))+CDbl(nz([txtmatcost7],0))+CDbl(nz([txtmatcost8],0))+CDbl(nz([txtmatcost9],0))+CDbl(nz([txtmatcost10],0))

This works well for the sum of above text boxes.
However it is not bound to the txt box - I put it in the control source

What I want to do is bound the text box so I can easily bring up the sum so I can use the answer in various reports.

1st question is this the proper way to do this? or should it be done in a query?
2nd question if it is - where do I input the above and how?

Summary of what I am looking for is to have the sum of the text boxes to be able to be viewed on a report.

Thanks for your direction
Gary
Nov 16 '08 #1
2 1546
Stewart Ross
2,545 Expert Mod 2GB
Hi. Binding is not really what you mean here - a bound control is one which is bound to an underlying field in a table. It is not normal practice to store computed values in a table - these should be computed on demand, using a query to do so.

You do need to be clear, however, that whilst you are summing textbox control values at the moment these are just a means of displaying data on a form. It is the fields of the underlying query or table to which the textboxes are bound which should be summed, not the textbox values themselves. That way you are not dependent on the form being open at the time you do the computation.

My advice therefore would be to add the computation as an additional computed field with a suitable name to whatever query you currently use as the source for your form. You will then have an up-to-date summed value available every time you run the query.

The computed field is entered into a blank column in the Access query editor as something like this:

Expand|Select|Wrap|Line Numbers
  1. Summary Total: CDbl(Nz([firstfield], 0)) + CDbl(Nz([secondfield], 0)) ... CDbl(Nz([Lastfield], 0))
Equivalently, in SQL this is just

Expand|Select|Wrap|Line Numbers
  1. Select <your existing fields>, CDbl(Nz([firstfield], 0)) + CDbl(Nz([secondfield], 0)) ... CDbl(Nz([Lastfield], 0)) As [Summary Total]
  2. FROM <name of your query or table>...
-Stewart
Nov 16 '08 #2
Thanks Stewart for your reply.
Makes sense and the answer I expected. Did what you suggested and worked well.
Thanks for your help
Gary
Nov 20 '08 #3

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

Similar topics

14
by: NotGiven | last post by:
I am guessing I would hold a variable of when it's opened, then in the script that runs when the page is offloaded, I coudl calcualte it. How do you store a time variable? How do you calculate...
14
by: expertware | last post by:
Ok! to avoid confusion I will start a new argument. Thanks!! FIREFOX 1.0.7 AND IE6 viewed through DATATIME: a summary REPORT ===============================================================...
1
by: simonmarkjones | last post by:
Hi can someone please help me with a query. I would like to view only the current record with a query so i can create a report to be used as a customer receipt. How can i do this? Many...
3
by: crjunk | last post by:
Currently I have a Crystal Report that automatically loads as a PDF in the browser whenever the user views the report. This is working great. What I would like to do is add code that automatically...
2
by: AA Arens | last post by:
In "Repords" I used the "New" tool and made a Report in columns. However, I only get the first record viewed, not the others. What's going on? Bart Access 2003.
3
by: jubejell | last post by:
I am creating a report that will show us the number of tickets completed and the total time spent completing these tickets. I am able to get it to show me the data for like the last week. WHERE...
2
by: teneesh | last post by:
I have a report where the field ConfType is viewed grouped vertically in a ConfType Header. Now I need to change it so that it is viewed horizontally across the page. How the heck do i do this? I...
0
by: Prasanta | last post by:
Hello, In my system the crystal report working till yesterday as well, but from today whenever I tried to open crystal report its asking me to log on to crystal management server, which never...
2
by: Prasanta | last post by:
Hello, In my system the crystal report working till yesterday as well, but from today whenever I tried to open crystal report its asking me to log on to crystal management server, which never...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.