Hi folks,
I am new to VB (from Access VBA) and have what must be a simple problem.
I have a table of records containing both ID numbers and names. I want a combo box that displays the names yet stores the numbers. In Access, one would put a combo box on the form, set it to two columns with column 0 set to zero width. Then one would set the combo’s rowsource to a query with SQL of:
SELECT id, name FROM table ORDER BY name;
In VB, we have to use the AddItem method. How do I get a combo box that stores one value, but displays another? Indexes must be sequential, starting with zero, so they are not what I want.
This is so simple that there must be an easy answer to this. Thanks!
-Brian
I am new to VB (from Access VBA) and have what must be a simple problem.
I have a table of records containing both ID numbers and names. I want a combo box that displays the names yet stores the numbers. In Access, one would put a combo box on the form, set it to two columns with column 0 set to zero width. Then one would set the combo’s rowsource to a query with SQL of:
SELECT id, name FROM table ORDER BY name;
In VB, we have to use the AddItem method. How do I get a combo box that stores one value, but displays another? Indexes must be sequential, starting with zero, so they are not what I want.
This is so simple that there must be an easy answer to this. Thanks!
-Brian