General information
Category:
Forms & Form designer
Title:
Unloading form via toolbar
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only