Showing a total in a Form!!!

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

Guest

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)
 
In the form footer band, add a text box. in the control source of the box
type =sum([yourfield])

hope it helps
 
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)
 
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]")
 
Back
Top