MasterRacker
New member
I was using a IIF to avoid a divide by zero problem. The IIF did not work, expanding to a full If-Then-Else structure did work correctly.
Is there some subtlety I'm missing or is this a compiler quirk to beware of?
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
Is there some subtlety I'm missing or is this a compiler quirk to beware of?
Code:
Does NOT work:
avgPrice = IIf((onHand![onHand] < 1), 0, runningTotal / onHand![onHand])
Works:
If (onHand![onHand] < 1) Then
avgPrice = 0
Else
avgPrice = runningTotal / onHand![onHand]
End If
Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]