>As far as I know, if you run your function from a form (say, command button), this function already operates within Private Form's DS, so you don't need to do anything special.
Yes, this is my experience, too.
>Otherwise you can pass Form's DS as a parameter. My colleagues use SET DATASESSION to lnPassedDS lots of times in a code without problems...
Thanks; the "without problems" is the part that interested me.
Instead of a parameter, I plan to get .DataSessionId, from _vfp.ActiveForm. You see, the reason I want an outside function in the first place is because I want to have a generic function called from a menu. So, I can't pass a parameter from the form.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)