Totals on Forms

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

Guest

I have a form on which there are a series of records in a matrix – example as
follows

Amount Amount Amount

Record 1 50.00 80.00

Record 2 50.00

Record 3 50.00

Record 4 50.00 50.00


Totals 150.00 100.00 80.00


I am constructing the totals by summing the values in each column.
However, the totals do not work. I suspect the problem is because some of
the values in the columns are null. The totals work fine when there is a
value in every slot.
I want the form to appear with blanks when there are no values (as in the
above example).

How do I get the totals to work?
 
You should be able to make three textboxes, one for each column and in
the control source put =Sum([YourFieldName]). I took your sample data
and tested it and this solution worked great.

Hope that helps!
 
Jeff

Your advice worked fine.

However, I now want add a grand total of the totals on the form.

I created a text box and entered the following in the source.............

=Total1+Total2+Total3 (where Total1, Total2 and Total3 are the names of the
controls on the form).

I do not get an error, but the grand total appears blank on the form.
 
What you have in your textbox should work fine. I'm not sure why it is
not for you. I did it with my test data and it totaled the 3 amounts.


Jeff

Your advice worked fine.

However, I now want add a grand total of the totals on the form.

I created a text box and entered the following in the source.............

=Total1+Total2+Total3 (where Total1, Total2 and Total3 are the names of the
controls on the form).

I do not get an error, but the grand total appears blank on the form.


--
Thanks in anticipation.


Jeff L said:
You should be able to make three textboxes, one for each column and in
the control source put =Sum([YourFieldName]). I took your sample data
and tested it and this solution worked great.

Hope that helps!
 
I still can't get this to work.
However, it occurs to me that in my real data the third column does not
contain any values and therefore total 3 is null - this may be causing the
problem. The grand total shows zero (the default value) momentarily then
displays a blank in the text box.
--
Thanks in anticipation.


Jeff L said:
What you have in your textbox should work fine. I'm not sure why it is
not for you. I did it with my test data and it totaled the 3 amounts.


Jeff

Your advice worked fine.

However, I now want add a grand total of the totals on the form.

I created a text box and entered the following in the source.............

=Total1+Total2+Total3 (where Total1, Total2 and Total3 are the names of the
controls on the form).

I do not get an error, but the grand total appears blank on the form.


--
Thanks in anticipation.


Jeff L said:
You should be able to make three textboxes, one for each column and in
the control source put =Sum([YourFieldName]). I took your sample data
and tested it and this solution worked great.

Hope that helps!
 
I have added the NZ function to my calculation i.e the source for Grand Total
= NZ([Total1],0)+NZ([Total2],0)+NZ([Total3],0). This seems to have solved the
problem.


--
Thanks again.

Jeff L said:
What you have in your textbox should work fine. I'm not sure why it is
not for you. I did it with my test data and it totaled the 3 amounts.


Jeff

Your advice worked fine.

However, I now want add a grand total of the totals on the form.

I created a text box and entered the following in the source.............

=Total1+Total2+Total3 (where Total1, Total2 and Total3 are the names of the
controls on the form).

I do not get an error, but the grand total appears blank on the form.


--
Thanks in anticipation.


Jeff L said:
You should be able to make three textboxes, one for each column and in
the control source put =Sum([YourFieldName]). I took your sample data
and tested it and this solution worked great.

Hope that helps!
 
Back
Top