Subject Re: add an item to ib_lookupcombo
Author james_027
Here is my technique. I will use a TStringlist and put some value
correspond with the ib_lookupcombo. For example if you have the
following items in your ib_lookupcombo ...

ALL PRODUCTS (which is equal to 0)
MILK (which is equal to 1)
JUICE (which is equal to 2)
MINERAL WATER (which is equal to 3)

first I will declare the variable like this

var
itemvalue: tstringlist;

second i will put some value;

itemvalue:=tstringlist.create;
itemvalue.commatext:='0,1,2,3';

please refer to delphi help on how to use the tstringlist.commatext
properties.

So if you choose the MILK if will return the value 1 right? Is that
what you mean?

you will need this to get the value 2

itemvalue[ib_combobox.itemindex];

then just put a condition if all products are selected

if itemvalue[ib_combobox.itemindex] = 0 then
select all product
else
select product base on the select item in the combobox


hope this will help you


--- In IBObjects@yahoogroups.com, "m_kavcic" <m_kavcic@y...> wrote:
> Hello everyone,
>
> I am doing reports and would like to add an item at the beginning
> to lookupcombo to select all products.
>
> Like this:
> 0, all products (added item)
> 1, milk
> 2, juice
> 3, mineral water ...
>
> How can I do that?
>
> Thanks, Marko