How to display the second column in ComboBox after selection?
source link: https://www.codesd.com/item/how-to-display-the-second-column-in-combobox-after-selection.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How to display the second column in ComboBox after selection?
I can click on my ComboBox and see the values of Column1 and Column2, but after I click on off the ComboBox, the value in Column1 is always displayed and I want the value of Column2 displayed.
I tried this:
With ComboBox2
.Value = "None"
.ColumnHeads = True
.ColumnCount = 2
.ColumnWidths = "50;100"
.RowSource = "SetupQuestions!A42:B48"
.BoundColumn = 2
End With
That didn't set the value as I thought it would.
I tried this:
Private Sub ComboBox2_AfterUpdate()
ComboBox2.Value = ComboBox2.Column(2)
End Sub
That didn't set the value as I thought it would.
How can I force the ComboBox to display the value in Column2 after a selection is made?
Argh! It's not .Value
It's .Text
Private Sub ComboBox2_AfterUpdate()
Me.ComboBox2.text = Me.ComboBox2.Column(1)
End Sub
Related Articles
how to exclude the second column from the selector
How to display the second word first with the dot
Oracle: How to display the second or third letter in each sentence word as a CAPITAL letter in Oracle
Insert in a column by selecting another column in another table, but how to fill the second column
How to display the second largest value rather than the lowest value
How to get the second column value of the row invoked in the table?
How to display the scroll bars in TScrollBox after being rendered visible again?
how to display the euro symbol in css after and before the pseudo-elements
display the values in the second drop-down list after selecting the value in the first drop-down list
How to display the second page in pagination
How to display the second tab in Android while calling from an activity
How to display the second Modal ViewController in the UINavigationController by program
how to display the entire entry in String after execution?
Codeigniter - How to display the results of the database vertically as columns instead of rows
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK