Thisform refers to the form that code is in, in your example it is form2. One way to accomplish what you want is to make form2 MODAL and then in the Button in form1 that calls form2 you put;
* Form1's buttonDOFORM Form2
Thisform.Savemode() && this line will not execute unitl the modal fomr2 is dispatched