If formula with three separate condititons

D

Database User

I want my if formula to do the following:
If total owing is >0 it should say "Amount Outstanding"
If total owing is <0 it should say "Credit Remaining"
If total owing =0 it should say nothing i.e. null

How do i write the formula
 
D

Duane Hookom

If this is a text box on a form or report, you can set the format property
to:
Format: "Amount Outstanding";"Credit Remaining";"";""
 
D

Database User

I don't understand what you mean i've got an amount field it can either be >0
, <0 or =0. so the box next to it i want to say one of these three choices?
Please help
 
D

Duane Hookom

Set the control source of your text box to your total owing
field/expression. Then set its format:
Format: "Amount Outstanding";"Credit Remaining";"";""
 
F

fredg

But how will it know when to display what, where have i told it?

I guess it's because Access is smart!!
Did you try Duane's suggestion. It will work.

For more information on his method, take a look in Access Help:
Format + Format Property + Number and
Currency datatypes
 
K

Kernow Girl

Hi Database user - try this. Note - [TO] is whatever your total owing field
is called

iif( [TO]>0,"Amount Outstanding",iif([TO]<0,"Credit Remaining"," "))

The first IIF stmt checks if [TO] is greater than 0 and inserts the text
Amount Outstanding if that is TRUE. If it is FALSE is goes on the the next
test and inserts the text Credit Remaining is that test is TRUE. If neither
are TRUE it defaults to " " which is just a blank field.

Hope this helps - Yours - Dika
 
Top