Barry,
When the form is unloaded, I believe that any variables or properties that you created in the form to hold the data you want to return have already been released. This is why you are getting an undefined variable returned. A trick I use is to pick an unused global foxpro variable (like _GETEXPR )to hold the form's return value and return it in the unload event.
HTH
Ron Seidl
Independent Developer
VFP
"I'm playing in life's theater in anticipation of a great cast party!"