sum field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,i have quite a noob question i guess.. but the following is the
problem:

on a form i have 5 fields with layer thickness of a coating.
underneath that, theres a cumulative field.. my question

how do i get the sum of the 5 fields in that 6th textfield.
the name of the fields: Layert(1 t/m 5) and the cumulated field "sum"
they are all numeric.

could anyone help me?
 
zandbak,
Create an unbound calculated field with... (use your own names)
= NZ(Field1) + NZ(Field2) + NZ(Field3) + NZ(Field4) + NZ(Field5)
 
I'm sorry, i still cant figure it out, what i get now is a parameter value
request box.
how do i solve this???
 
zandbak,
Since this is a form, and you get a Parameter request, I'm assuming you have a
fieldname in the query behind the form, that the query can not resolve.
Run the query behind the form... do you get a Parameter request? Then the missing
parameter must be in there.

Since you didn't provide any field names on the form, I used example names like Field1,
Field2, etc...
Replace my example names with the Names of your fields on the form.
 
i feel verry stupid haha sorry, but...
what do u mean with NZ ?
And where do i have to write this down? in a (by example) on Click event? of
the textfield?

grtz zandbak
 
Apologies... I posted a response (the "parameter stuff") to you by mistake.
My original post to you was...
Create an unbound calculated field with... (use your own names)
= NZ(Field1) + NZ(Field2) + NZ(Field3) + NZ(Field4) + NZ(Field5)

Place a TextControl on your form, and in the ControlSource put...
= NZ(Field1) + NZ(Field2) + NZ(Field3) + NZ(Field4) + NZ(Field5)
Use the actual names of your form fields.

The NZ function says "If any of these fields is null, consider it a 0" If you don't
use NZ, any null field value will cause the calculation to fail.
 
Back
Top