set safety off oform = createobject('testform') oform.show() read events DEFINE CLASS testform AS form DoCreate = .T. Caption = "Form1" Name = "Form1" DIMENSION colvalues[1] ADD OBJECT list1 AS listbox WITH ; BoundColumn = 1, ; ColumnCount = 2, ; ColumnWidths = "120,120", ; RowSourceType = 5, ; RowSource = "thisform.colvalues", ; Height = 170, ; Left = 25, ; Top = 20, ; Width = 288, ; BoundTo = .T., ; Name = "List1" ADD OBJECT label1 AS label WITH ; Caption = "Value:", ; Height = 17, ; Left = 36, ; Top = 204, ; Width = 40, ; Name = "Label1" ADD OBJECT label2 AS label WITH ; Caption = "DisplayValue:", ; Height = 17, ; Left = 36, ; Top = 228, ; Width = 96, ; Name = "Label2" ADD OBJECT text1 AS textbox WITH ; Height = 23, ; Left = 86, ; Top = 201, ; Width = 262, ; Name = "Text1" ADD OBJECT text2 AS textbox WITH ; Height = 23, ; Left = 149, ; Top = 225, ; Width = 199, ; Name = "Text2" PROCEDURE Init CREATE TABLE testtable (ccol1 c(20), ccol2 c(20), ccol3 c(20)) For i = 1 TO 10 m.ccol1 = 'column 1 record '+ALLTRIM(STR(i)) m.ccol2 = 'column 2 record '+ALLTRIM(STR(i)) m.ccol3 = 'column 3 record '+ALLTRIM(STR(i)) insert INTO testtable FROM memvar endfor select testtable dimension this.colvalues(RECCOUNT('testtable'),2) SCAN this.colvalues(RECNO('testtable'),1) = testtable.ccol2 this.colvalues(RECNO('testtable'),2) = testtable.ccol3 ENDSCAN this.list1.requery() USE IN testtable this.list1.listindex = 1 thisform.text1.value = this.list1.value thisform.text2.value = this.list1.displayvalue thisform.text1.refresh() thisform.text2.refresh() ENDPROC PROCEDURE list1.Valid DODEFAULT() thisform.text1.value = this.value thisform.text2.value = this.displayvalue thisform.text1.refresh() thisform.text2.refresh() ENDPROC PROCEDURE list1.Click DODEFAULT() thisform.text1.value = this.value thisform.text2.value = this.displayvalue thisform.text1.refresh() thisform.text2.refresh() ENDPROC PROCEDURE destroy DODEFAULT() CLEAR events ENDPROC ENDDEFINE>I am using a parameterized view, view is working fine, need to have 3 columns in my list box, need to populate column2 and column3.
>>>scan >>> citem1 = alltrim(field1) >>> citem2 = alltrim(field2) >>> citem3 = alltrim(field3) >>> >>> thisform.list1.addItem(citem) >>> >>> ** how do i add to my code to add citem2, citem3 to the list box >>>endscan >>>>>>