To find out why it isn't working, you need to know what the error is.. rather than simply ignoring it as you are doing. I realise that it is a useful thing to do for a 'live' application, but it stops you from finding problems when debugging.

Remove (or comment out) the On Error line so that you see the error message, and the line that causes the problem.