I am writing a system which uses a form with buttons as a main menu. When the uses selects a button a program is run (report, data input screen, etc.) and then they should return to the main form. I load the form as an object from main.prg. My problem is when I go to show the form again in the main.prg the object is no longer valid. This program works initally but crashes at OBMENU.SHOW(1) after it returns from running 'do ChrmReport'.
oBMENU = NEWOBJECT("MainMenu","chrommmainform.prg",'',lcBAckControl)
DO WHILE .t.
OBMENU.SHOW(1)
enddo
RELEASE obmenu
The code in the button being run is
DEFINE CLASS cmdReport as label
NAME = "cmdReport"
caption = 'REPORTS'
PROCEDURE CLICK
thisform.deactivate()
DO CHRMReport
thisform.activate()
ENDPROC
ENDDEFINE