Showing a total in a Form!!!

K

Kwgame

I have a form and want to show the total hours from one column in a query in
a small label box or text box in the form. I don't want to take the whole
column with each individual value but I just want to show the total in the
form. Does anyone know how to do this, seems like it would be easy? (P.S.
Is there a way to do this also with out doing a subform too, maybe some code
or something linking it to that sum of hours)
 
X

xg

In the form footer band, add a text box. in the control source of the box
type =sum([yourfield])

hope it helps
 
K

Kwgame

Thank you!!

Ofer Cohen said:
If the query contain only one record that hold the sum of the field, you can
use DLookUp in the control source of the text field



=DLookUp("[FieldName]","[QueryName]")



If there are few records and you want to sum one of the columns, then use
the DSum function in the control source of the text field



=DSum("[FieldName]","[QueryName]")



Kwgame said:
I have a form and want to show the total hours from one column in a query in
a small label box or text box in the form. I don't want to take the whole
column with each individual value but I just want to show the total in the
form. Does anyone know how to do this, seems like it would be easy? (P.S.
Is there a way to do this also with out doing a subform too, maybe some code
or something linking it to that sum of hours)
 
O

Ofer Cohen

If the query contain only one record that hold the sum of the field, you can
use DLookUp in the control source of the text field



=DLookUp("[FieldName]","[QueryName]")



If there are few records and you want to sum one of the columns, then use
the DSum function in the control source of the text field



=DSum("[FieldName]","[QueryName]")
 
Top