Overflow Problem

matthewnsarah07

Registered User.
Local time
Today, 01:07
Joined
Feb 19, 2008
Messages
192
Code:
Me.TotalSamppe = IIf([TotalRecppe] < 1, "0", ([TotalCompppe] / [TotalRecppe]) * 100)

I have used this live in some vb code for a while, not sure why but now its causing and overflow - can anyone tell me why this might be??

Thanks for any help
 
i think an iif statement still evaluates both parts, so if [TotalRecppe] IS 0, the second part will cause an overflow (divide by zero) error
 

Users who are viewing this thread

Back
Top Bottom