Basically no, not the way you're doing it.
A loop is designed to execute some ## of times.
The GUI is designed to take input at any time.
They don't really mix. The loop will continue loop, and when will the user have time to type? It doesn't work.
Maybe try using InputBox?
Also, If Val(txtn.Text) Mod 2 = 0 = False Then, looks funny. Why are there 2 == signs? Are you trying to find even/odd numbers or what? You should only need one =.