Cetin ---- your suggestion works great! Thank you!!
Joe
>>I'm working on an application written in VFP 5.0 and have a grid on a form which I create at runtime. I need to change the controlsource to checkbox instead of textbox (see code below)
>>
>>THISFORM.grid1.ADDCOLUMN(2)
>>THISFORM.grid1.COLUMNS(2).NAME = 'colBox'
>>THISFORM.GRID1.colBox.WIDTH = 30
>>THISFORM.grid1.colBox.HEADER1.CAPTION = ''
>>THISFORM.grid1.colBox.HEADER1.ALIGNMENT = 2
>>THISFORM.grid1.colBox.currentcontrol = 'Check1'
>>
>>My code errors out on the last line. What am I doing wrong?
>>
>>Thanks,
>>
>>Joe
>
>with THISFORM.grid1
> .AddColumn(2)
> with .COLUMNS(.columncount)
> .NAME = 'colBox'
> .Controlsource = "myTable.myLogicalField"
> .WIDTH = 30
> .HEADER1.CAPTION = ''
> .HEADER1.ALIGNMENT = 2
> .AddObject('Check1','CheckBox')
> .Check1.Caption = ''
> .Check1.Visible=.t.
> .currentcontrol = 'Check1'
> .Sparse = .f.
> endwith
>endwith
>
>Cetin