Multi-column combobox

Multi-column combobox

Post by jo » Wed, 06 Jun 2007 06:25:48

When using VBA and office user forms (Office XP), I was able to
populate a combobox from a stored procedure through ADO. I would
actually retrieve several columns or fields of information but only
display one in the combo box. When the user selected an item in the
combobox, I would store other column values into hidden textboxes or
variables for future reference so I wouldn't have to requery later.

I would do this by coding something like

textbox1.text = cboBox.column(3) or whatever specific column id I

How do I accomplish this in vs2005?

Multi-column combobox

Post by Thoma » Thu, 07 Jun 2007 19:16:28

jo, it's better not to use hidden text boxes for such purposes. You can
store this value in a member variable (in the form's code) and you can
retrieve it trough ComboBox.SelectedValue property. But I doubt you
really need this - why don't you retrieve this value only when you need it?


NConstruct - Intelligent Software Factory