If you use thisformset.addobject then you can leave the code in Form2 unchanged but you have to define separate class from it (means to remove Form2 from formset and save it as class).
If you need to access Form1 methods from "independent" Form2 then you cannot use the form name but you have to provide the form object reference of Form1 to Form2. You could find the Form1 object reference from _screen.forms or you can pass this reference as parameter:
If you will call Form2 from Form1 by
DO FORM Form2 WITH THISFORM
then the calling form reference is passed to Form2.Init method as a parameter and you may use this parameter value to access Form1 methods and properties. Remember the parameter is just variable having some scope - when the Init event code exits then this variable disappears so you have to store its value into some form property:
Form2.Init:
LPARAMETER loCallingForm
*-- Some Init code
*-- Store the calling object reference
THISFORM.CallingFormReference = loCallingForm && CallingFormReference is property of Form2
*-- etc.
RETURN
When referencing Form1 use simple:
THISFORM.CallingFormReference.command7.setfocus( )
THISFORM.CallingFormReference.command7.click
This approach is valid but not so correct in OO environment. Form2 should not know about all Form1 controls and their properties. You should call just some public method from calling form and this method should do the work.
Same rules are valid if the form is in a formset. In such case you should call mehods from the formset only and formset should propagate such call to its child forms. The concept is "Object encapsulation" and you should communicate via some public interface only.
I know, programs must be delivered sometimes...