another quick reply:
you can use the datasource in controls programatically by entering some code like object.datasource=valfield(someparameter)
procedure valfield
lparameters someparameter
local retorno
select sometable
set order to index1
seek someparameter
if found()
retorno=somefieldreturn
else
retorno="not found"
endif
return retorno
hope this helps