Ms Access 97

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

sammy662001

Thread Starter
Joined
Dec 23, 2005
Messages
3
can some1 please show me how to save a calculated data from a report or a form into a table. i know a bit about access but i am no expert. thank you and a happy xmas.
 
Joined
Nov 13, 2003
Messages
1,021
It is not a good idea to have calculated fields in your tables. If you must store the values, do it in a query. The best way is to setup the query with the calculated field and then use the query in the form or report.
 

OBP

Joined
Mar 8, 2005
Messages
19,896
You can also do the calculation with simple VBA in a form that puts the value in to your field on the form.
You use the "After update" procedure of the field(s) that you want to calaculate on.
In the procedure you would put something like
[field name 1] = [field name 2] * [field name 3]
that would multiply fields 2 and 3 together and put the result in field 1.
 
Joined
Aug 5, 2005
Messages
3,086
Arguably the only good reason to store a calculated field in a table is if you need it for historical purposes. For example, if you have pricing information that is based on current market trends like the Fed, and you need to retain that pricing for archival purposes, then you might be able to use a calculated field in a table. The general rule of thumb is, if it will be calculated once and only once, ever, then it's okay. If, on the other hand, you're trying to use Access like Excel, then I'd adhere to the good advice already posted by coachdan32 and OBP.

If you do need more info about anything so far, post back and we'll get you started.

chris.
 

sammy662001

Thread Starter
Joined
Dec 23, 2005
Messages
3
Thank you guys for your help, what I have is a report called “Invoices” with a “txtTotal” that calculates 3 text boxes, this report gets the data from a query that’s based on 2 tables called “Invoices” and “InvoiceDetails” but I need to save that total preferably in the table “Invoices”.

I need to make a report for VAT purposes, so I can have a list of the paid invoices with their totals; I thought it might be easier to save it from the report into the table as I have a field in the table called “Total”.
 

OBP

Joined
Mar 8, 2005
Messages
19,896
From which table does the report get it's fields for doing the calaculation, as that is the best table to store it in if you must store it. The field would be updated when the data is entered. Assuming you are using a form to do the data entry?
For historical records already entered you would need to run an update query.
Can you post a zipped (empty) copy of the database on here?
 

sammy662001

Thread Starter
Joined
Dec 23, 2005
Messages
3
as i said the report gets its fields from a query which based on 2 tables "Invoices" + "InvoiceDetails", the field "Total" is in the invoices table but it is always 0.00 as i don't know how to update it. i will post a copy of the database as soon as i get the chance.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top