Subject DBLookupComboBox and TIBOQuery
Author Shawn Devlin
Hi,

I am having trouble getting a DBLookupComboBox to work with an id field. I
am using TIBOQuery for both the main edit and the lookup.

I have two tables, part and account_code. account_code has two fields, id
and name. part has an account_code_id field. I want to set up
DBLookupComboBox to show the user the name field from account_code but to
store the id field in account_code_id.

I can click the dropdown and the list of possible values. But when I click
on one the list closes up but the field stays blank.

For the combo box, the values are:
DataSource: PartDs
DataField: account_code_id
ListField: name
ListSource: AccountCodeDs
KeyField: id

The SQL for the account_code query is "select id, name from account_code
order by name"

The EditSql for the part query is "update part set in_stock = :in_stock,
location= :location, retail_price = :retail_price, description=
:description, account_code_id = :account_code_id, product_type_name =
:product_type_name where part_number = :old_part_number and supplier =
:old_supplier"

The SQL the PART table is "select part_number, supplier, in_stock, location,
retail_price, description, account_code_id, product_type_name from part
where part_number = :part_number and supplier = :supplier"

The odd thing is that I have a similar lookup for product_type_name, only it
uses the actualy name, there is no id. That works just fine.

C++Builder 6 and IBO version 4.2.Id


Any ideas?


--
Shawn W. Devlin


[Non-text portions of this message have been removed]