HI,

"txtP1.text <> 0 then"

What I am trying to draw your attention to is that you are NOT testing for zero value. You are testing for the number 0. If an alphabetical letter or a null is in txtP1.Text, you will get a runtime error.