Combobox not displaying expected result.

  • Thread starter Thread starter Mitch
  • Start date Start date
M

Mitch

Hi,

I have a form with a combobox on it.

The combobox pulls its rowsource via an sqlstatement from a table of data.

The combobox has 3 columns displayed when I pull it down to make a
selection, but once I make a selection it only displays the bound column,
which is normal. is there anyway to have it display all the columns? or am
I better off adding some labels next to is and updating their captions via
dlookup() for the other info that the end users wish to see associated with
the selected combo item.

Thanks in advance.
Mitch
 
Have your combo show three columns.
These would be columns 0, 1 and 2

Then update some unbound fields or labels on your form:

Private Sub Combo_AfterUpdate()
strField1 = Combo.Column(1)
strField2 = Combo.Column(2)
End Sub

Saves doing lookups as your combo already did that!

Mich
 
Hi,

I have a form with a combobox on it.

The combobox pulls its rowsource via an sqlstatement from a table of data.

The combobox has 3 columns displayed when I pull it down to make a
selection, but once I make a selection it only displays the bound column,
which is normal. is there anyway to have it display all the columns? or am
I better off adding some labels next to is and updating their captions via
dlookup() for the other info that the end users wish to see associated with
the selected combo item.

Thanks in advance.
Mitch

1) Regarding >it only displays the bound column, which is normal.

A combo box displays the first column which has a width greater than
0". It may or it may not be the bound column.

2) There is no way to have a combo box display more than one column
after a value has been selected.

3) You can add unbound text controls to the form.
Then code the Combo Box's AfterUpdate event:
[Control1] = Me!ComboBoxName.Column(1)
[Control2] = Me!ComboBoxName.Column(2)

Note that combo boxes are zero based, so Column(1) is actually the 2nd
column, etc.
 
oh man... now why on earth didnt I think of this solution... DOH!. :)
Thanks again!!! Works A-1.
 
Back
Top