Hi Lennert,
Yes that's what I meant (almost). You do not have to create object of the class based on session outside of the form, though. You can instantiate it at the point where you need it.
>
>In my case the focus was not on the grid (it was on a textbox) but the grid complained.
>But in the meantime I think I understand what Sergey wrote, and I think he is right.
>
>- Before the form opens, declare an new sessionobject
>- Define a userdefined method for the session
>- In that method of the session call your prg.
>- Now from within your form, call loSession.Yourmethod. Now you don't do an explicit "set datasession to", but because the code is from within the sessionobject, it will operate in that session. Implicit you switch sessions now, and thereby may avoid the problem.
>
>I think this is what Sergey meant. I didn't test it, by the way. If this is it, S. deserves the stars...
--sb--