Calculation problems

potts

Registered User.
Local time
Today, 22:55
Joined
Jul 24, 2002
Messages
87
I have a report with three subreports. It's a happy camp, except that I want to display a grand total in the main report based on the sub totals in each report. Not a problem normally, however, there will be numerous occasions where one or more of the sub reports will be blank and as such, the calculation returns an "error" value.

Does anyone know how I might get this value calculated considering all values may or may not be there??
 
You could use an iif statement
eg controlsource of GrandTotal

=IIf(IsNumeric(Forms!MainFormForm!Subform1.Form!Control) = true, Forms!MainFormForm!Subform1.Form!Control,0) + IIf(IsNumeric(Forms!MainFormForm!Subform2.Form!Control) = true, Forms!MainFormForm!Subform2.Form!Control,0) etc

haven' tried it myself yet though!
 
The HasData method is the correct way, there have been many examples posted here
 

Users who are viewing this thread

Back
Top Bottom