Recent

Author Topic: [SOLVED] DBLookupComboBox Problem  (Read 4263 times)

oraitecamonyes

  • New Member
  • *
  • Posts: 31
    • http://blog.ptvet.com
[SOLVED] DBLookupComboBox Problem
« on: August 18, 2009, 01:25:03 pm »
Hi once more  :D

I have included a DBLookupComboBox in my project and i got it to list the field that i want. The problem is that when i try to select an item or if i try to write in the DBLookupComboBox it wont select or accept chars !!??

here is my code:
Code: [Select]
form1.sqlquery2.SQL.clear;
 form1.sqlquery2.sql.add('SELECT cli_id, cli_nome FROM clientes;');

 if(form1.MySQL50Connection1.connected=false)then form1.MySQL50Connection1.connected:=true;
 if(form1.SQLTransaction1.active=false)then form1.SQLTransaction1.active:=true;

 form1.sqlquery2.Open;
 DBLookupComboBox1.ListField:= 'cli_nome';
 DBLookupComboBox1.KeyField:=  'cli_id';


thx once more!!

SOLVED
the problem was that in the DBLookupComboBox1 component i was setting both DATASOURCE and LISTSOURCE and i only needed to select LISTSOURCE.
Now it works fine with autocomplete.   8-)
« Last Edit: August 18, 2009, 02:29:26 pm by oraitecamonyes »

 

TinyPortal © 2005-2018