Using MS Access/autocalculate field

Advertisement


Question
Level of experience: Beginner(new)

Hello Mr. Rost!!
I'm new in MS Access and I'm trying to make a simple invoice program for our small business.
I have "Qty", "Cost", and "TotalCost" as my fields and i want to autocalculate the value of the "TotalCost" field and save the calculated data as well.
 
(TotalCost=Qty*Cost)

thanks a lot in advance!!

Answer
If it's a value that you can recalculate on the fly, there's no need to save it in the table (well, there are exceptions, but this is a general rule). You can use a CALCULATED QUERY FIELD like this:

TotalCost: Qty * Cost

Now just use that query field for everything else (forms, reports, etc.) and it's just as good as if the data was stored in the table.

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Richard Rost

Expertise

I am happy to answer any kinds of questions about Microsoft Access - from basic table design to advanced VBA programming. Also, please feel free to check the Access Tips & Tricks section of my web site, and free Access 101 tutorial.

Experience

I am the president of AccessLearningZone.com and 599CD.com. I specialize in Microsoft Access Tutorials. I have been teaching Access in the classroom since 1994, and online since 2002.

Education/Credentials
I am a self-taught Access expert. I have been building databases for clients since the early 90s. You can see a sample of my Access Tutorials on my web site at 599CD.com

©2016 About.com. All rights reserved.