Access Forms

K

Kelly K

I need to put calculations into a form so that it will add feilds together. I
can't find how to do this in the form information only in querys. If I set it
up there will it affect my form? I hope Im asking the the question
correctlly, I'm very new (self taught) to Access.
 
P

Philip Herlihy

Kelly said:
I need to put calculations into a form so that it will add feilds together. I
can't find how to do this in the form information only in querys. If I set it
up there will it affect my form? I hope Im asking the the question
correctlly, I'm very new (self taught) to Access.

You can do this either way. I'm inclined to think that it's better to
do all the arithmetic you can in the underlying query as it seems to me
that it's easier to understand that way.

I have a billing system which (for example) has one table which stores
price and quantity. I multiply them in a query to produce a "cost"
field, and have a text box on my forms/reports which displays this value.

However, you can set the "control source" of a control (a text box is
one example of a control) to an expression based on any of the fields
which are available from the "record source" of the form or report.
It's very common to have a text box in a footer (group footer, page
footer or report footer) whose control source is: = Sum([field of
interest]) for example.

It's worth fooling around with the "expression builder", which is a
wizard which helps you put together expressions using fields and
functions. Bit of a struggle at first, but it repays study.

Does that help? Or should I have waited for the clearer head that the
morning will surely bring?

Phil, London
 
L

Linq Adams via AccessMonster.com

You can do this either way. I'm inclined to think that it's better to
do all the arithmetic you can in the underlying query as it seems to me
that it's easier to understand that way.

I agree, it's better to base a form on a query and calculated fields for your
math. Then you simply use the calculated field as the ControlSource for your
form control. The advantage of this approach is that you can also use the
query as the source for any reports you need to create, and once again, the
calculations are already done in the query.

If you don't do it this way, but rather "do the math" in the form, and later
need the same thing in a report, you'd have to "do the math" all over again
in order to get it to appear in the report.
 

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