SQLite: How to create lookup fields? lazarus / 16-Databases ---------------------------------------------------------------------- vice · 2008-12-24 15:21 Hi, I have two TSQLite3Dataset components: DatasetSales with the fields: Code, Item, Amount, Price, Vendor DatasetItems with the fields: Code, Description I have a TDBGrid component that shows the data of DatasetSales. I want to make a lookup field associated to the Item DatasetSales field to show the Code and Description DatasetItems fields. I do it: Code: [Select]procedure TForm1.FormCreate(Sender: TObject); begin   with DatasetSales do     begin       Open;       DatasetItems.Open;       FieldByName('Item').FieldKind := fkLookup;       FieldByName('Item').LookupDataSet := DatasetItems;       FieldByName('Item').LookupKeyFields := 'Code; Description';       FieldByName('Item').LookupResultField := 'Code';     end; end; but nothing happen. Why? Thanks and Merry Christmas. ---------------------------------------------------------------------- tatamata · 2008-12-25 08:38 Hi. You should remove field 'Description' from LookupKeyFields. In LokupKeyFields put only those fields that are present in both datasets. It's a link between two datasets. Regards, Zlatko