Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement