dont you need an exit sub after each cancel
otherwise the code will continue to test the next possible case, until the end of the sub
i dont really use stuff like this, but as cancel is an integer, perhaps setting it true is the wrong value for what you are trying to do?