Math addition of fields on a subform

G

Gary.

Hi
I am trying to setup a data base that requires some math

What I need to do is to work with fields in a sub form

I need to take the Cost, ShopDrawing and Freight fields and add them
together on the sub form I need suggestions on how to do this. Is VBA and
option?

Thanks
Gary Hull
 
A

Al Campagna

Gary,
Please indicate a few rows of sample data, and the result
you'd like to see... if the suggestion below does not work for you.
Also, my suggestion assumes that none of the values are
unbound calculations.

In a single record...
=Cost + ShopDrawing + Freight
In the subform footer...
=Sum(Cost) + Sum(ShopDrawing) + Sum(Freight)
--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."
 
G

Gary.

Gary,
Please indicate a few rows of sample data, and the result
you'd like to see... if the suggestion below does not work for you.
Also, my suggestion assumes that none of the values are
unbound calculations.

In a single record...
=Cost + ShopDrawing + Freight
In the subform footer...
=Sum(Cost) + Sum(ShopDrawing) + Sum(Freight)

That works

I will be multiplying the results by a %, (35%) is that a problem

Also would it be better to do calculations from a VBA function?
 
K

Klatuu

I would suggest enclosing the values in the Nz function to avoid a Null
return. Also note the objects in the calculation should be the names of the
controls involved. The result should be the Control Source property of the
control that displays the result of the calculation:

=Nz(txtCost,0) + Nz(txtShopDrawing,0) + Nz(Freight,0)
 

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