General information
Category:
Coding, syntax & commands
>back again. i think this might be a quick one but who knows.
>
>in one form ("form1") i issue a command "do form form2 to oretval_email"
>
>in form2, i have a command button that creates an "empty" object named oretval_email and i add properties to it. in the form's unload event, i have :
>
>lparameters oretval_email
>return (oretval_email)
>
>i was having some problems with this so i checked online and found that i also have to make sure that the destroy event of the command button has to have the variable/object available. therefore, i added the following lines to the command button's destroy event.
>
>lparameters oretval_email
>return (oretval_email)
>
>now, for the command button's click event, i added the following at the bottom to make sure the object was available to the other events:
>
>this.Destroy(oretval_email)
>thisform.Unload(oretval_email)
>
>my problem is that the object is available even at the point where the unload event occurs, but, for some reason, the unload event statement "return(oretval_email)" seems to run twice, and the second time makes the object ".f.".
>
>does anyone have any ideas how to correct this?
>
As an alternative to Jim's solution, add a property to the called form to hold the return value. Then, you don't have to worry about variable scope. In your button click:
This.oRetVal_Email = whatever
In Form.Destroy:
RETURN This.oRetVal_Email
Tamar
Previous
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