the best way to use err.number <> 0. in case of any error err.number value would be anything other then 0.
Once you are at the end of the loop you can use err.clear to set it default.
Once you are at the end of the loop you can use err.clear to set it default.