Prefix a total if it's a credit?

K

Kevin

I have a report that gives the sum in a control in the group footer. The
Control Source is: =Sum([SellPrice])+[SalesTaxAmount]

That can be either a positive amount, or a credit. Is there an expression
that can be written to prefix a negative number (a credit) with the word
"Deduct"?

Knowing the power of Access, I assume this would be quite simple, but I just
don't know how to accomplish this. I appreciate any help!
Thank you!
 
F

fredg

I have a report that gives the sum in a control in the group footer. The
Control Source is: =Sum([SellPrice])+[SalesTaxAmount]

That can be either a positive amount, or a credit. Is there an expression
that can be written to prefix a negative number (a credit) with the word
"Deduct"?

Knowing the power of Access, I assume this would be quite simple, but I just
don't know how to accomplish this. I appreciate any help!
Thank you!

Set the Format property of the control to:
#,##0.00;"Deduct " #,##0.00;0.00;

You need to make sure the control is wide enough to display all the
text and number.

In Access help, look up
Format property + Number and Currency datatypes
 
M

MDW

=IIf(Sum([SellPrice])+[SalesTaxAmount]>=0,Sum([SellPrice])+[SalesTaxAmount],"Deduct " & Sum([SellPrice])+[SalesTaxAmount])
 

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

Top