Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unloading form via toolbar
Message
From
02/09/2003 14:51:44
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Unloading form via toolbar
Miscellaneous
Thread ID:
00825431
Message ID:
00825431
Views:
53
I wish to enable users to save changes and quit a modal form which returns a numeric value using the code 'DO MyForm TO lnFormValue'.

If I close the form using a button on the form, the form's Unload() event returns a numeric value, as expected. The button's click() code is as follows...
WITH thisform
IF .save() && validate data and commit changes
.release()
ENDIF
ENDWITH


Ever on the lookout for a more generic solution, I would like the function to be called by a toolbar button instead of a button on the form. My toolbarbutton.click code is as follows...

WITH _screen.activeform
IF .save()
.release()
ENDIF
ENDWITH

This closes the form ok, but returns .F. instead of the expected numeric value, as if the unload() event is being bypassed. I have traced execution from when the toolbar button is pressed and form.unload definitely executes 'RETURN lnReturnValue' as its last line. lnReturnValue holds a numeric value, but .F. is returned to lnFormValue above!

Has anyone any idea what may be going on here, and how I can solve this (frustrating) problem. Any help would be appreciated.

Alan
Next
Reply
Map
View

Click here to load this message in the networking platform