View Full Version : Summing in Forms


Milton Jacoby
06-18-2001, 08:12 AM
Hi!

I know that you can obtain a sum total of a field in the table the form is based on, by creating a text box "sum(fieldname)".

But that only works when the form is opened in "edit" mode. How can I obtain the above sum when opening the form in "Add" mode?

Thanks All

MJ

D-Fresh
06-18-2001, 08:18 AM
MJ,

Your best bet is to put the text box in the footer with the control source of "=sum([FieldName])". However, you have to refresh the form everytime you add a new value to the form. So you can put this command in the After Update event of your field.. "Forms![Form_Name].Refresh"

Hope that helps..

Doug

AlanS
06-18-2001, 08:19 AM
Try creating a text box whose RecordSource property is:

=DSum(field_to_be_summed, table_containing_field)

Both arguments to the DSum function must be string expressions.

Milton Jacoby
06-18-2001, 09:08 AM
Thanks All.

In my case, AlanS's post helped me. I think because I needed a total of ALL records in the table, not only the one's entered in the current session.

Thank's again for a speedy answer

MJ