* form init Create Cursor flds (Choice N(1),fld_name c(20),fld_Type c(1),; fld_length N(10)) Select * From data03\okul2 Into Cursor CrsOkul2 gnFieldcount = Afields(gaMyArray) Clear For nCount = 1 To gnFieldcount lcfldname=gaMyArray(nCount,1) && name lcfldtype=gaMyArray(nCount,2) &&type lcfldlen=gaMyArray(nCount,3) &&len Select flds Insert Into flds(choice,fld_name,fld_type,fld_length) Values ; (1,lcfldname,lcfldtype,lcfldlen) Endfor this.grid1.RecordSource ="flds" this.Refresh With Thisform.Grid1 .Columns(1).RemoveObject('text1') .Columns(1).Newobject('_checkbox1','_checkbox','lib\_base.vcx') .Columns(1).CurrentControl='_checkbox1' .Columns(1)._checkbox1.Visible=.T. .Columns(1)._checkbox1.Caption='Choice' .Columns(1).Sparse=.F. .autofit .refresh Endwith
* show selected fields button code SELECT fld_name from flds WHERE flds.choice=1 INTO CURSOR CrsSelected browse