Board index » delphi » How do I create lookup fields in run time without creating persistent fields at design time
Dennis Poon
![]() Delphi Developer |
Tue, 26 Nov 2002 03:00:00 GMT
How do I create lookup fields in run time without creating persistent fields at design time
Because of the dataset descendant I am using, I prefer to use NO persistent
fields at design time. At run, time I want to create a lookup field but can't QuoteI wrote: Size := 10; Lookup := true; Index := 1; FieldName := 'Customer'; Name := 'ContractsCustomer'; FieldKind := fkLookup; LookupKeyFields := 'Key'; LookupResultField := 'ShortName'; LookupDataSet := Companies; // a table Dataset := Contracts; // another table KeyFields := 'CustomerKey'; End; Contracts.FieldDefs.Update; Contracts.Open; // this line raise exception and said "customerKey" not found. However, I got an exception at the line contracts.open and it said what a dilemna. Can someone help please? Dennis |