Need help again ! Other Problem PLEASE!!!!

make

Member
Hi,
in my table are two fields.
One field(text), the second, I have made visible by an Combo box.
I put the screen-value VALUE of the Combo in a variable(named Lieferung), which of the type Char is. The other field is the Primary Key(Integer).
What i want to do :
I want to store the value of the associated Primary key in another variable.
How can I do that?

Greetings
make
For example :my Table:

PK Lieferung
------------------
1 Soup
2 Milk
3 Cream ......
 

dkellgren

Member
make -

I think what you want to do is what I eluded to at the end of the last email - use the LIST-ITEM-PAIRS.

Are you on V9? If so, try this:

Define the Combo-box with LIST-ITEM-PAIRS rather than LIST-ITEMS.

LOAD the combo-box using:
FOR EACH TableName NO-LOCK:
cb-name:ADD-LAST(TableName.Lieferung,TableName.PK).
END.

In the ADD-LAST, the FIRST item is what will be displayed on the screen. The SECOND item is the screen-value "value".

So when you want to assign it back to the DB or to another variable, you can say, SomeTableName.PK = cb-name:SCREEN-VALUE and the actual "value" that is stored would be the PK, rather than the Lieferung.

You can "clear" or "blank" out the combo-box by using: cb-name:LIST-ITEM-PAIRS = ? and then running that "FOR EACH" statement again.

HTH

-dk-
 
Top