Repeated use of calculated fields - save in a query??

C

CW

In the pricing part of our database we have numerous calculated fields i.e.
sub-totals and grand totals for various sections of the quote and the final
job costing.
We need to refer to these frequently and pull them into forms, letters,
queries and reports.
Rather than create the calculation within a control each time I need to use
one of these amounts, would it be best to create and save a query that
contained them all, and then use that as the record source for the control
whenever needed?
Is this the most sensible way to do it?
Many thanks
CW
 
K

Klatuu

That would be a good way to do it.
Another way, where the calculations may be too complex SQL, you can write
functions to do the calculations and call the functions from the forms or
reports. Public functions can also be called from queries.
 
C

CW

Dave -
Many thanks...however I'm afraid you have lost me when it comes to "writing
functions" and "calling functions".
Could you please point me in the right direction to find out more about this?
Thanks again
CW
 
K

Klatuu

It has to do with VBA. If you are not familiar with VBA, you should learn
it. It greatly enhances your ability to deliver good applications.
There are two types of functions in VBA. Intrinsic functions are those that
are built into VBA. Some are included in libraries that you can add to your
relations in VBA. The other type is User Defined. That is, you write VBA
code that performs calculations or other activities and returns a value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top