>Hi Cetin:
>
>Sorry to be a pest,
>
>I ommitted the original code you gave me, used the code from the last thread,
>and I get an error when I add the iif statement a get error:
>
>the data object must be a variable resource -
>
>I put lnsincolumn = 1
> lnsurnamecolumn =2
>in the init of my form and iif statement in controlsource for column.
>
>function surdesc - I placed with all my other functions.
>
>checked typing and ok,
>
>I sometimes get an error like this when function undefined in my
>functions file, but this is not the case here.
Oh my god this was the shower :) Till from start when reading I totally skipped that this is a matter of grid :) There seems to be forgotten quotes surrounding "iif()".
Using arrays in grid sometimes tricky. I would suggest another easier way then :
select gidetail.sin, client.surname,client.firstname, client.phone1;
from gidetail, client;
where gidetail.sin = client.sin;
and gisum.sessionkey = gidetail.sessionkey;
into cursor aclient nofilter
index on sin tag sin
select gidetail
set relation to sin into aclient
with thisform.myGrid.Columns(2)
.controlsource = "aClient.Surname"
.readonly = .t.
endwith
Cetin