Terrific!
I agree with Cetin's point about passing references about (much more elegant), but this is definitely a good trick to add to the arsenal.
>>I have been trying unsuccessfully to get a return value from a form created
>>I know there must be a better way.
>
>Whoa! Don't do Public! Try this:
>
>To return a value from a form
>
>1. Set the WindowType property of the form to 1 to make the form modal.
>2. In the code associated with the UnLoad event of the form, include a RETURN command with the return value.
>3. In the program or method that runs the form, include the TO keyword in the DO FORM command.
>
>For example, if FindCustID is a modal form that returns a character value, the following line of code stores the return value to a variable named cCustID.
>
>DO FORM FindCustID TO cCustID
>
>This was in VFP3 help but I couldn't find it in VFP5 help. ("help returning" at the command window.)
>
>I've used it several times & it works like a charm.
>
>JR