PDA

View Full Version : Dblookupcombobox


norg
06-14-2001, 11:49 AM
Hi All..
I take datas from access and put them ưn to an dblookupcombobox when i run my application my dblookupcombobox first field is always empty i want when my application run dblookupcombobox shows the first row?
how can i do it

osamaao
06-14-2001, 12:13 PM
Try this:
procedure OnFormActivate(Sender: TObject);
begin
dbListCombo.ItemIndex := 0;
end;

Hope this will help.

douglas
06-15-2001, 10:02 PM
for a dblookupcombobox to work properly, you must set its listsource, listfield, keyfield correctly, "look up" means that the this field's value is not arbitrary, it should be found somewhere else: for example, you have a table order which has a field custno, you know for sure each order must be from one of the customers that in another table customer, so in this case, you can setup your dblookupcombobox like this: datasource := datasourceOrder; field := CustNo; ListSource := CustomerSource; listField := CustName; KeyField := Custno;

you can now choose from customer names when making an order! it's much better that type customer No.