I'm trying to determine a Loan to Value Ratio. I have been able to successfully calculate the field using the following FormCalc code, written on the calculate event of my field named "Asset1LVR":
This is fine and all, but if the user has not yet filled out the "PPRValue" field, then the arithmetic over/underflow error occurs because the value of PPRValue is null.
I have been using a script like this one below on other parts of my form where I was having the same trouble, and the code below works like a charm. For some reason I cannot get this code to work with my Loan to Value Ratio scenario. It is not producing anything in the "Asset1LVR" field at all, so appears to be doing nothing.
if ( Page4.TotalPropertyTable.Row2.PPRValue >0) then
Page4.TotalPropertyTable.Row2.PPROwing / Page4.TotalPropertyTable.Row2.PPRValue * 100
Any help is much appreciated, thank you.
I managed to come across the answer in another post I missed earlier (REPOST - "Arithmetic Over / Underflow" Error). I've changed my code to what is shown below, and seems to work perfect. Hopefully someone else will find this useful.
// check for divisor having a value and not zero
(HasValue(Page4.TotalPropertyTable.Row2.PPRValue) and Page4.TotalPropertyTable.Row2.PPRValue <> 0) then
// perform division
// display nothing