If function in query

C

Chantelle

I have made an if function which is not working. I have tried both the
expressions below.
=IIf(>5,"Stock level OK","Order more Stock")

=IIf([No in Stock]>5,“Stock level OKâ€,“Order more Stockâ€)

If the field which is called No in Stock is more than 5, I want the field to
display Stock level Ok. If it's less than 5 I want the field to display
Order more stock.

Can anyone help?
 
J

John Spencer

If this is in a query and you are using the query grid then try.

Field: Stockorder: IIF([No in stock]>5,"Stock level OK","Order more Stock")
 
T

Tom Lake

Chantelle said:
I have made an if function which is not working. I have tried both the
expressions below.
=IIf(>5,"Stock level OK","Order more Stock")

=IIf([No in Stock]>5,"Stock level OK","Order more Stock")

If the field which is called No in Stock is more than 5, I want the field
to
display Stock level Ok. If it's less than 5 I want the field to display
Order more stock.

Can anyone help?
If you're making a control on a form or report with the above formula as its
source, make sure the name of the control is NOT [No in Stock]

Tom Lake
 
Top