Subject IB_LookupCombo + OnChange Event
Author Andrei Luís
Hello,

I'm having problem on using OnChange of IB_LookupCombo.

I have the following scenario:

Form: frmSales

1 IB_LookupCombo to choose the customer.
Several IB_Edits like Salesman, payment terms, delivery date, etc...

When I choose any customer, I'd like to fill in the Salesman IB_Edit
with the value that is stored in Customer Table. I need this, cause
the salesman that is stored in customer table is just a sugestion.

qrCustomerLookup
Fields: ID, Name, SalesMan

qrSales
Fields: ID, Customer_ID, SalesMan

So, in IB_lookupCombo onChange event, I have something like that:

qrSales.FieldByName('SalesMan').asString :=
qrCustomerLookup.FieldByName('SalesMan').asString;

But, nothing is working, when I click on a customer at IB_LookupCombo,
the value didn't appear, and SalesMan on Sales table is not filled.

If I comment the code above, the value appear, but SalesMan is not
filled, of course.

As I verify by debuging, the OnChange is triggerd twice (!?), the
first one, the cursor on qrCustomerLookup is OK, where I clicked and
qrSales.Salesman is filled perfect, but the second one, the cursor is
empty, and then qrSales.Salesman is filled with an empty string.

What I'm doing wrong.

Hope I was clear, my english is too bad...

[]s
Andrei

Win XP Pro + D2006 Pro + FB 1.5.2 + IBO 4.6B