Access Expressions Problem

K

KC

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.
 
F

fredg

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.

=Sum(IIf(IsNull(Cancel Date]),[Amount],-[Amount]))
 
K

KC

Great, that worked!

fredg said:
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.

=Sum(IIf(IsNull([Cancel Date]),[Amount],-[Amount]))
 
Top