Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form object lost when calling program
Message
From
22/10/2003 14:18:39
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Form object lost when calling program
Miscellaneous
Thread ID:
00841199
Message ID:
00841199
Views:
45
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'.
*Main.prg
oBMENU = NEWOBJECT("MainMenu","chrommmainform.prg",'',lcBAckControl)
DO WHILE .t.
	* display the menu
	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
Next
Reply
Map
View

Click here to load this message in the networking platform