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

how do i sum up the values of a field?

I have a table with a number of fields and many records and I need to sum up the values of cells of a column that meets certain criteria (eg. column1=column2, iif(column3=0)) and then sum it up to become a value under a new column in a new table.

I need to make a number of these new summation values to make up a new table of two rows and a number of columns (depending on the number of summed values i need)

How do i do this with VBA code? or any other method (but i need this to be run when one clicks on a button on a form)

Thank you!!
Nov 25 '08 #1
2 5549
PianoMan64
374 Expert 256MB
Hello again Kwokv616,

Once again, what you're describing is what can all be done in a query.

Once thing to keep in mind, with MS Access, it is very BAD programming practice to sum values from one table and added them to another table for review.. The problem inevitably is that some of the data will change, and you will have to go back and re-sum all the value again.

The way that we get around this is to simply base a form on a query that will display the calculated information the way that you would like. Then you can start to base forms and reports on this query.

So the query would look something like this:

Expand|Select|Wrap|Line Numbers
  1. SELECT Sum(Column1) FROM TableName WHERE Column1 = Column2 or Column3 = 0
  2.  
This doesn't require any VBA coding at all. this can be done in the query builder that comes with MS Access.

If you need more detailed help, let me know, and I would be more than happy to help.

Joe P.
Nov 25 '08 #2
My required endproduct is:
A summed value in another table under a new column

Which means after summing up the values using your given SQL to give one new value, i would need it to display this new value under another column name.

How do I do this?

Thanks alot =)
Nov 25 '08 #3

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

Similar topics

0
by: Duncan Smith | last post by:
Hello, I'm not very experienced in SQL and I need some advice. I have a comma separarated values file containing around 20 million records and about 20 fields. There are many missing values...
1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
10
by: MLH | last post by:
I have an A97 table with a Yes/No field named TowJob and a form bound to that table. The TowJob control on the form is bound to the same field. It is an option group with Yes and No bttns valued...
1
by: Chippy | last post by:
I am having trouble working out how to update a field on an open form with a calculation based upon calculations from other tables! For example, I have 3 tables: Diary Diary_ID: autonum,...
8
by: Chris A via AccessMonster.com | last post by:
I have an interesting problem that I have yet to come accross that I can't change data structure on because it is an export from filemaker I am reformatting for another dept. anyway. I have a table...
1
by: Intrepid_Yellow | last post by:
Hi, I have the following code that runs my report generator. The user selects a table from a combo box, then whatever fields they want from a list box. (This part all works and the report runs...
2
by: MyGreatProgramme | last post by:
I want to make a delete query that deletes all the items that are in the minorty. For example, in the field " Houses " there are 10 rows with value 1 , 3 rows with value 3 and 4 rows with...
0
by: jiaudheen | last post by:
i work on C#,asp.net.. my grid has 10 fields and 25 records. i allowed sorting and paging. some fields holds numeric values(int ,float, double..etc). the task is to add all the values field...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.