Alan,
It seems we discussed a similar problem in
Re: Unloading form via toolbar Thread #
825431.
>Here's an odd one which I cannot explain...
>
>
>I need to store a form's return value to a variable, which I do using the following code...
>
>LOCAL lnFormValue
>lnFormValue = .NULL.
>DO MyForm TO lnFormValue && MyForm is a modal form
>
>If I close the form by clicking on the cross in the top-right of the window, everything works ok and I end-up with the expected value for lnFormValue. However, if I close the form via a toolbar button, the resulting value of lnFormValue is still .NULL., and the form value is lost.
>
>The close button Click() code is...
>LOCAL loForm
>loForm = _screen.activeform && form object reference
>
>IF loForm.QueryUnload()
> loForm.Release()
>ENDIF
>
>The Form.Unload() code contains
>RETURN thisform.returnvalue
>and I have checked that this code is being executed before control returns to the calling procedure.
>
>Has anyone any idea how I can get my return value when closing the form via. a toolbar button? Any help would be appreciated.
>
--sb--