Access Expressions Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
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]))
 
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]))
 

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

Back
Top