we can see the line affected - so what is the error message?
Only thing I can see wrong with line is if the value is null then substitute 0 (what the nz function does). But then you would be trying to compare the number 0 with text - which I would thing would generate an error.
Other...