display the item in tdbmemo from combobox
- by zizil
i have combobox that have value category1 and category2...the category1 have items like pencil,food,magazine,newspaper...
when i choose category1, i want to retrieve the items in tdbmemo.then the same items in tdbmemo i want to display in
checklistbox...i dont know how to do...i use clcat.items.add to display the item but the items is not display
procedure TfrmSysConfig.FillInCheckListClCat;
var
sTable : string;
sqlCat : TIBOQuery;
iIndex :integer;
lstCat : TStringList;
begin
if tblMain.FieldByName('POS_ReceiptCatBreakDown').AsString <> '' then begin
sqlCat := TIBOQuery.Create(nil);
sqlCat.IB_Connection := dmMain.db;
lstCat := TStringList.Create;
try
sqlCat.SQL.Text := 'SELECT code FROM ' + cboCategory.Value;
sqlCat.Open;
while not sqlCat.Eof do begin
clCat.Items.Add( sqlCat.FieldByName( 'Code' ).AsString );
sqlCat.Next;
end;
finally
lstCat.Free;
sqlCat.Free;
end;
end;
end;