IF NOT PEMSTATUS(_screen,"MyRef",5) ADDPROPERTY(_SCREEN,"MyRef[1]",.F.) DIMENSION _SCREEN.MyRef[2] _SCREEN.MyRef[1] = .NULL. && Reference to form 1 _SCREEN.MyRef[2] = .NULL. && Reference to form 2 ENDIF DO FORM Form1Then in the Init and Destroy methods of Form1:
PROCEDURE Init _SCREEN.MyRef[1] = thisform ENDPROC PROCEDURE Destroy _SCREEN.MyRef[1] = .NULL. ENDPROCThe same in the Init and Destroy methods of Form2:
PROCEDURE Init _SCREEN.MyRef[2] = thisform ENDPROC PROCEDURE Destroy _SCREEN.MyRef[2] = .NULL. ENDPROCNow either form can access the other via the _SCREEN.MyRef reference. Use the ISNULL() function to determine if the form is opened. If there can be multiple open windows, then you will need a more extensive collection to manage the form references.