Are you possibly declaring the variable 'counter' inside the timer event sub? If so, it gets reinitialized each iteration and will never reach 30. And if this is the case, declare the variable at form level in general declarations.