You need to put quotes around the controlsources:
ex.
thisform.Grid1.column1.text1.controlsource = c_codigo_a
should be
thisform.Grid1.column1.text1.controlsource = "c_codigo_a"
Another option would be to set the ControlSource of the column rather than the textbox
Rick
>Hi all,
>
>I have a form with some options and then based in a select statement i want to populate a grid, but i get an error,
>
>select * ;
>from jbfic!familias A ;
>left outer join jbfic!familiascli B ;
>on b.c_codcli = lcCli ;
>and a.c_codigo = b.c_codigo ;
>order by a.c_codigo ;
>into cursor cursor1
>
>ThisForm.Grid1.recordsource="cursor1"
>ThisForm.Grid1.columncount=4
>thisform.Grid1.column1.width=55
>thisform.Grid1.column2.width=125
>thisform.Grid1.column3.width=45
>thisform.Grid1.column4.width=45
>
>thisform.Grid1.column1.text1.controlsource = c_codigo_a
>thisform.Grid1.column2.text1.controlsource = c_descri ----> ERROR:The data source for this object must be a variable reference. And then ignores the above 2 lines.
>thisform.Grid1.column3.text1.controlsource = n_desc1
>thisform.Grid1.column4.text1.controlsource = n_desc2
>THISFORM.GRID1.REFRESH()
>
>I have 6 fields in cursor1 but i only need to show 4. My Cursor1 have c_codigo_a,c_descri,c_codigo_b,c_codcli,n_desc1,n_desc2.
>
>Thank's in Advance.
>
>João Batista