What do you mean by 'the code fails'?

Are you referring to the Checkbox?_Click event procedures? If so what does the code do?