I have this code in vb6 that needs to calculate the feet per second of the value in the first column or the second column based on the distance. If there is no value in either column then leave the F1fps blank also. I'm getting a division by zero because it's not coded properly
Case Is >= 8
If gFieldMapping.GetFieldValue(r, "frac #2 " & detailRecordNum) <> 0 Then
F1fps_Calc = FormatNumber(((2640 - (gFieldMapping.GetFieldValue(r, "bl1c " & detailRecordNum) * 9)) / gFieldMapping.GetFieldValue(r, "frac #2 " & detailRecordNum)), 2)
Else
F1fps_Calc = ""
End If
Case Is >= 8
If gFieldMapping.GetFieldValue(r, "frac #2 " & detailRecordNum) <> 0 Then
F1fps_Calc = FormatNumber(((2640 - (gFieldMapping.GetFieldValue(r, "bl1c " & detailRecordNum) * 9)) / gFieldMapping.GetFieldValue(r, "frac #2 " & detailRecordNum)), 2)
Else
F1fps_Calc = ""
End If