Try doing this:
form1.hide
form2.show
What's happening with your code I think is that your showing the second form, but doing form1.end is quickly passing focus back to form1. You need to hide the first form, then show the second (there is also a difference between hiding a form and closing or destroying it, you could do some things with that fact as well).