Hello Cetin
hmm, didn't know that about the error on ds. but sorry, still doesn't work. i tryied your 2 suggestions and even hardcoded for testing purpose the ds id - no effect, the command does not switch the ds.
>
>Gunnar,
>Sorry couldn't read the whole thread and don't know if you already checked this. The macro substition there looks like as the culprit. Set datasession doesn't error with macro substition even if it was something erroneous ie: DummyVariable is not defined and:
>set datasession to &DummyVariable
>doesn't error and doesn't do anything (as if you did "set datasession to")
>
>
if Type("_screen.ActiveForm") = "O"
> CurrentDS = set("datasession")
> CallingFormDS = _screen.ActiveForm.DatasessionId
> if CallingFormDS <> CurrentDS
> ResetDS = .t.
> set datasession to CallingFormDS
>* or
> set datasession to _screen.ActiveForm.DatasessionId
> endif
>endif
>Cetin