FancyFace
07-12-2001, 09:58 PM
Hi All,
I have a TDBLookupListbox that I would like to have filled at runtim. Actually, I have a button on a form and when the button is clicked,it should fill the TDBLookuplistbox with the lookup values. If I set the ListSource, ListField and Keyfield at design time it works fine. The code I use at runtime is :
lookuplistbox.listsource := SourceName;
lookuplistbox.listfield := DataModule.TableName.FIELDBYNAME('field name').AsString;
lookuplistbox.Keyfield := DataModule.TableName.FIELDBYNAME('field name').AsString;
Say for instance the first value of the fieldname is RWI,
the error would be: lookuplistbox: Field 'RWI' not found
I don't know what is wrong, Any help will be appreciated !
By the way, I use Delphi 4.
Thanks
Christiaan
I have a TDBLookupListbox that I would like to have filled at runtim. Actually, I have a button on a form and when the button is clicked,it should fill the TDBLookuplistbox with the lookup values. If I set the ListSource, ListField and Keyfield at design time it works fine. The code I use at runtime is :
lookuplistbox.listsource := SourceName;
lookuplistbox.listfield := DataModule.TableName.FIELDBYNAME('field name').AsString;
lookuplistbox.Keyfield := DataModule.TableName.FIELDBYNAME('field name').AsString;
Say for instance the first value of the fieldname is RWI,
the error would be: lookuplistbox: Field 'RWI' not found
I don't know what is wrong, Any help will be appreciated !
By the way, I use Delphi 4.
Thanks
Christiaan