Thread: Calculation
View Single Post
  #5  
Old December 13th, 2006, 02:25 PM posted to microsoft.public.access.forms
Sprinks
external usenet poster
 
Posts: 531
Default Calculation

Damian,

The last parameter is optional. If omitted for numeric values, the function
will return zero by default.

Sprinks

"Damian S" wrote:

You missed the ,0

=Sum(Nz([ActualAmount], 0))

D.


"Sprinks" wrote:

Awach,

Convert Null values to zero with the Nz function. See VBA Help for further
information and options. Try:

=Sum(Nz([ActualAmount]))

Sprinks


"awach" wrote:

I have a continous subform where the user can enter a value [Actual Amount].
Then there is a value, named [Total], that sums all of those amounts:
Sum([Actual Amount]).

However, there is a case where there may not be any records entered. In
that case, I would like [Total] to equal 0.

I tried IIf(IsNull([ActualAmount]),0,=Sum([ActualAmount]) but it doesn't
seem to be working. Any ideas?