Is there a possibility two add a second value to a listbox?

Hey everyone

I’m using a listbox and populating it by using the following sql-statement:

The column “name” is the shown text in the listbox and the column “code” is the bound field value.

After the user selected an item a macro is called to read out the selected value (which comes from the column “code”).

Is there a possibility to read the selected value in column “discount” without having to make a DB-call as the values have been already loaded in the list box?

Thanks for the feedback.

Listboxes should show one value and save another value. So you could get the Value by “Current Value” and the shown field by the position. But there is no other field planned - so no possibility to read this field.

So you have to write a query in the macro:
SELECT ""discount"" FROM ""taxation_type_itp_tpo"" WHERE ""code"" = '"+stValue+"'"
where stValue is value of the listbox.

Hey Robert,

thanks for giving it a look. I implemented it already like you suggested.

Have a great day.