Sum Records in a subform.

S

SHIPP

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?
 
B

Bruce M. Thompson

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top