You can only display one column. If you want the user to be able to view the data in the other columns, you can use text boxes that are filled based on the value in the combo box.
If you place them next to the combo box, you can create the illusion of displaying all columns.
The result of cocatenating field names and the pipe symbol in the combo box field is rather sloppy and unprofessional looking. I suggest sticking to the standard method of creating your combo box and using text boxes to display the additional fields.
Following Randy700, you can also show and hide controls on top of the combobox (leaving the dropdown arrow visible). When the user selects a choice, make the controls visible, then populate the data. When the user clicks on the combobox's dropdown arrow, the combobox's "Enter" event hides the controls. For example, using 2 text boxes to display the data (text539 & text540)
Private Sub Combo537_AfterUpdate()
Me.Text539.Visible = True
Me.Text540.Visible = True
Me.Text539.Value = Me.Combo537
Me.Text540.Value = "data, etc"
Me.txtFocus.SetFocus
End Sub
Private Sub Combo537_Enter()
Me.Text539.Value = ""
Me.Text540.Value = ""
Me.Text539.Visible = False
Me.Text540.Visible = False
End Sub
Note: You need to use the SetFocus to move focus to another control besides the combobox, or the "Enter" event wont trigger if the user clicks the combobox back2back
Just another note, I have used this type of code before on forms and it works fine. If you play around with turning off the border colors, etc, and you have the text boxes appear right on top of the combobox, it will look seamless.
If the user clicks in one of the text boxes to activate the control, then shift the focus to the combobox, hide the text boxes, and issue a drop down menu command on the combobox.
aperez54, yes that will work while the combobox is in dropdown status, but once the user makes a selection, then the combobox will only display the data for the "Bound Column"
If I understand the question right, after the selection is made he wants the combobox to show multiple columns of data.
Thanks for all your tips. Appreciate it. I will play around with the code and see what I can come up with. rustychef you understood my question exactly
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.