Overflow when field is Zero

matthewnsarah07

Registered User.
Local time
Today, 11:35
Joined
Feb 19, 2008
Messages
192
Code:
Me.TotalRlppe = ([rlTotalCompppe] / [rlTotalRecppe]) * 100

I have the above as part on On Load event to display results on a form - however on some occasions both fields used in the above calculation can be zero. Obvioulsy when this is the case I get an overflow error

Can I add anything to the code to get round this?
 
You can use an IIf() function to test the field for zero; return zero if so, your calculation if not.
 

Users who are viewing this thread

Back
Top Bottom