By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,314 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,314 IT Pros & Developers. It's quick & easy.

How to display zero when value <0 in control?

P: n/a
Hello

I have an Inventory text box in a datasheet that has the Control Source
property set to =[Qty]*[Cost] and the Format property set to Currency. The
datasheet is linked to the Stock table that has the Qty and Cost fields.

Sometimes the Qty value drops below zero and this causes a negative value in
the Inventory text box.

How would I get the Inventory text box to display zero when the Qty * Cost
is a negative value?

Thanks
G.Gerard
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try this:

=iif([Qty]*[Cost]<0,0,[Qty]*[Cost])

Make sure you have iif(, not if( as your function -- this is what works
in Acces. (In Excel, it's "if("...)

Good luck!

Nov 13 '05 #2

P: n/a
= IIF([Qty]*[Cost] <0,0,[Qty]*[Cost])

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"GGerard" <gg*****@nbnet.nb.ca> wrote in message
news:Jm**********************@ursa-nb00s0.nbnet.nb.ca...
Hello

I have an Inventory text box in a datasheet that has the Control Source
property set to =[Qty]*[Cost] and the Format property set to Currency. The
datasheet is linked to the Stock table that has the Qty and Cost fields.

Sometimes the Qty value drops below zero and this causes a negative value in the Inventory text box.

How would I get the Inventory text box to display zero when the Qty * Cost
is a negative value?

Thanks
G.Gerard

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.