Summing in Forms

  • Thread starter Thread starter Milton Jacoby
  • Start date Start date
M

Milton Jacoby

Guest
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
 
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
 
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.
 
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
 

Users who are viewing this thread

Back
Top Bottom