Hi David,
You can use PRIVATE variable instead. It'll be visible in the called form. Anyway, it should work. What happend when you run this code? Does form behaves as modless or it never displayed or something else?
>I wrote a function to return a product ID. It's meant to instantiate a public variable "pnProductID" which is defined when a product is selected from the form class "products". Then the product ID is return. Problem is the form is set to modal, but it doesn't stop program execution and the funtion returns .F. for "pnProductID". Does anyone know if there is some other way of returning a value from a form or am I doing something wrong? Any help would be great.
>FUNCTION GETPRODUCTID
><b>LOCAL lnProductID, oProductSearch
>PRIVATE pnProductID</b>
>oProductSearch = CREATEOBJECT('products',.T.)
>oProductSearch.Show(1)
><b>RETURN m.pnProductID</b>
>ENDFUNC
--sb--