|Subject||Re: Problem with event OnChange -> IB_LookupCombo|
Hi Helen, thanks for your help, the problem was solved... Answers are
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 11:29 AM 30/06/2005 -0300, you wrote:
> >I'm trying to use this code on OnChange event of IB_LookupCombo:
> >dm.qrSalesItems.FieldByName('Price').AsCurrency :=
> >This IB_LookupCombo points to dmLookup.qrProductSales.
> >The problem is: when I'm insert data in dm.qrSalesItems, and click
> >IB_LookupCombo, the record are shown, but, I can't choose any!
> >If I put the code on OnExit event of the same IB_LookupCombo, I can
> >choose normally a product.
> >Can't I use that code on OnChange event?
> No. The dataset and its relationships drive the controls, not the
> way around.
I'm still thinking like I used to do with Paradox, this just works
> The ib_lookupcombo is designed specifically for matching a
> unique lookup item with a non-unique value in the Keysource
> Keysource dataset is the one that wants to get a value from the
> The information you provide isn't adequate to tell what is wrong
> the minimum elements should be:
> 1) the lookup dataset's KeySource property must point to the
> the SalesItems set.
> 2) the values in the lookup list must be unique and not null.
> 3) the field name of the unique value should occupy the left side
> KeyLinks property, while the right side should contain the set-
> name of the Sales Details field that is to be linked to the lookup
> i.e. Sale_Price=qrSalesItems.Price
> If there are two members in the KeyLinks then they both must be
This solved the problem. I added the line
Sale_Price=qrSalesItems.Price and 'shazam', now I have the sale_price
when I choose any product.
> 4) Mastersource, MasterLinks, etc. must not be enabled between
these two sets