Sum Records in a subform.

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

Guest

I have a subform where I total up the entries. Then I use this calculation in another part of my main form. The problem is that when there are not any detail records the calculation in my main form returns and Error. Is there any way to force the subform total to zero if there are not any records?
 
I have a subform where I total up the entries. Then I use this calculation in
another part of my main form. The problem is that when there are not any detail
records the calculation in my main form returns and Error. Is there any way to
force the subform total to zero if there are not any records?

If you are using the "Sum()" function in the controlsource of a textbox in the
subform's footer section, you can use something like the following:

=IIf([Form].RecordsetClone.RecordCount,Sum([ExtendedPrice]),0)
 
Back
Top