Re: Combo Box Display Value

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Sithu wrote:
Hi all,

I have a combo box which has 2 columns : col1 an col2.
Bound column is col1.
When I select an item from the drop down list, it displays the value
of col1 as selected.
This is NOT what I want.

I want to display the values of col1 and col2 as selected.

How can I make it ?

With regards,
Sithu

You can have invisible columns in your Combo.RowSource.
The first column is always the one that gets displayed in
the combo's textbox area, i.e. when the combo is collapsed.

So in your scenario, you can put your concatenated two
columns into column one of the rowsource.
That way it gets displayed as combo.DisplayValue.

And put the content of the two separate columns into
RowSource column two and three, because you want to
display them in the dropdown.

If you additionally set ColumnCount = 3, and
ColumnWidths = '0,100,100', the first (concatenated) column
would be the combo.DisplayValue, but not appear in the
drop-dpwn area.

Additionally you can have invisible columns, for instance
a fourth one that contains the actual key value.
It would not get displayed anyway when combo.ColumnCount=3,
but you can make it combo.Value when you set
combo.BoundColumn = 4
If the bound column is numeric, you'll need combo.BoundTo=.T.



hth
-Stefan
.



Relevant Pages

  • Re: Combo goes blank on form requery
    ... There's a valid case where the combo's Bound Column is not its display column, and the RowSource is filtered in such a way that it does not have the record it needs to display. ... If the combo is selected, the selection may even be the width of the characters, but the characters are not visible. ... On a simple bound continuous form I have a combo for filtering the form by customer. ...
    (comp.databases.ms-access)
  • Re: Combo Box problems
    ... the same value as another and have it display the correct item. ... isn't equal to the bound column. ... the price * Qty value and display it in this field. ...
    (microsoft.public.access.forms)
  • RE: ComboBox Parameter Problem
    ... The bound column does not need to be visible to be used. ... the first column does not have to be ... > of 0 means the column will not display. ... >> column that needs to be picked up in the parameter query. ...
    (microsoft.public.access.forms)
  • Re: display value in combo box
    ... set the rowsource="" when moving to the next record. ... What are the Column Count and Bound Column properties of the combo box? ... display the value of the list without dropping it down. ... its Dropdown method. ...
    (microsoft.public.access.formscoding)
  • Re: Combo Box BoundColumn property
    ... HTH, ... Is it possible to display both columns yet return the contents of Column B ... Bound Column: 1 ... how can I set the BoundColumn property of the list so ...
    (microsoft.public.access.forms)