I am trying to enter an expression in the control field of my subform.
My goal is to have it add all amounts in the subform unless there is a date
in the cancel field. If there is a date in the cancel field I would like it
to subtract that amount.
=Sum([Amount])+(-[Amount]=[Cancel Date] Is Not Null)
This expression only subtract a value of 1 instead of the whole value in the
amount field.
> I am trying to enter an expression in the control field of my subform.
> My goal is to have it add all amounts in the subform unless there is a date
[quoted text clipped - 5 lines]
> This expression only subtract a value of 1 instead of the whole value in the
> amount field.
=Sum(IIf(IsNull(Cancel Date]),[Amount],-[Amount]))

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
KC - 08 Mar 2007 20:17 GMT
Great, that worked!
> > I am trying to enter an expression in the control field of my subform.
> > My goal is to have it add all amounts in the subform unless there is a date
[quoted text clipped - 7 lines]
>
> =Sum(IIf(IsNull([Cancel Date]),[Amount],-[Amount]))