Calculating subtotals within a form

G

Guest

Hi

I am creating a database of which certain forms contain customer contractual
values. I would like to calculate these values to give a sub total for each
customer record. I have created a text box for the total value and entered
the expression =(sum([field name 1]))+(sum([field name 2)) but this gives me
the overall total for the values entered in those fields and what I am
looking for is just the sub totals for the specific customer. i have tried to
include the Customer ID (which is unique)within the expression but it keep
spitting out an error message.

i would appreciate your help.

Many thanks

Úna
 
E

Ed Robichaud

SUM() is a function that totals all values of a field/control in all
records. Just make the control source of your unbound calculated control:

" =[myField1]+[myField2] "

-Ed
 
G

Guest

Hi Ed

Thanks for your help. I have tried this and it does not seem to work, when
the form is open I get "#Name?" and the field names are correct.

Thanks

Úna
message
Ed Robichaud said:
SUM() is a function that totals all values of a field/control in all
records. Just make the control source of your unbound calculated control:

" =[myField1]+[myField2] "

-Ed



na said:
Hi

I am creating a database of which certain forms contain customer
contractual
values. I would like to calculate these values to give a sub total for
each
customer record. I have created a text box for the total value and entered
the expression =(sum([field name 1]))+(sum([field name 2)) but this gives
me
the overall total for the values entered in those fields and what I am
looking for is just the sub totals for the specific customer. i have tried
to
include the Customer ID (which is unique)within the expression but it keep
spitting out an error message.

i would appreciate your help.

Many thanks

Úna
 
E

Ed Robichaud

The "#Name" error means a bad reference to your controls. Try renaming the
bound fields on your form to something else. For example, the text control
bound to the table/query field called "SalesDate" could be called
"txtSalesDate". Then base your calculated control on the new names
(=[txtSalesDate]+.....

-Ed


Una said:
Hi Ed

Thanks for your help. I have tried this and it does not seem to work,
when
the form is open I get "#Name?" and the field names are correct.

Thanks

Úna
message
Ed Robichaud said:
SUM() is a function that totals all values of a field/control in all
records. Just make the control source of your unbound calculated
control:

" =[myField1]+[myField2] "

-Ed



na said:
Hi

I am creating a database of which certain forms contain customer
contractual
values. I would like to calculate these values to give a sub total for
each
customer record. I have created a text box for the total value and
entered
the expression =(sum([field name 1]))+(sum([field name 2)) but this
gives
me
the overall total for the values entered in those fields and what I am
looking for is just the sub totals for the specific customer. i have
tried
to
include the Customer ID (which is unique)within the expression but it
keep
spitting out an error message.

i would appreciate your help.

Many thanks

Úna
 

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