Display column 4 in combo box AfterUpdate

  • Thread starter Thread starter Bradley C. Hammerstrom
  • Start date Start date
B

Bradley C. Hammerstrom

A2K

Say a combo RowSource query has 5 columns, with the last four visible in the
drop down list (column width of 0" for column 1). The bound column is column
1. After a selection is made, I want the displayed column to be the fourth
one, instead of the second one (the first column with a non-zero width).

How do you display a column other than the bound column in a combo box after
a selection is made?

Brad H.
 
In the after update event you should be able to requery the rowsource to rearrange the column order or reset the column widths properties but why would you want too? What happens when the user makes a selection, the change in the column order is made, and then the user decides that's not the option he wanted?

----- Bradley C. Hammerstrom wrote: ----

A2

Say a combo RowSource query has 5 columns, with the last four visible in th
drop down list (column width of 0" for column 1). The bound column is colum
1. After a selection is made, I want the displayed column to be the fourt
one, instead of the second one (the first column with a non-zero width)

How do you display a column other than the bound column in a combo box afte
a selection is made

Brad H
 
The text displayed in the combobox is from the first visible column, as you
stated. So, to make the fourth visible column display instead, you would
need to change the order of the fields in your query (left to right) to make
the fourth visible column the first one. Another option is to place a
textbox next to the combobox and set the control source of the textbox to

=cboMyCombo.Column(4)

The Column property's number is zero based, so 4 is the 5th column. Set the
Locked property of the textbox to yes and, if desired, the enabled property
of the textbox to no.
 
Back
Top