By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,086 Members | 1,919 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,086 IT Pros & Developers. It's quick & easy.

Multi-column Combo Box display

P: 1
This is more of a minor annoyance/curiosity than a real problem, but I'm wondering if anyone here can provide some answers.

I have a form bound to a table with lots of controls on it that are bound to fields of said table. I also have a combo box on the form that is unbound. I'm using it purely as a search mechanism. Anyway, the combo box dropdown is populated with data from a SQL query. There are 5 fields total, only the first 2 are displayed and the Bound Column is the 5th one. The 5th field happens to be the primary key from the table that the form is bound to, and when I select something from the dropdown, the other controls are populated with data from the record with that key. All of that works wonderfully.

Now onto the question. As I said, the dropdown displays 2 columns from my Record Source. However, when I select something, the control only shows me the value from the 1st column and not the 2nd. Is this the normal behavior? I'd like it to show me both values because I know the person that wants to use this form is going to wonder why it only shows the one. I thought I would be clever and concatenate the 2 columns during the AfterUpdate event and set the .Text property of the control to the new string, but since my bound column isn't the first one, the Limit To List property is automatically set to Yes and my text update causes an error.

I may go back and change the Record Source and make the displayed column an expression that uses the two values concatenated and is still bound to the primary key, but I thought I would ask here first. Any clues?
Apr 12 '07 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 14,534
You can essentially only display one value in a control so using a concatenated list is probably your only solution here.
Apr 13 '07 #2

P: 3
You can essentially only display one value in a control so using a concatenated list is probably your only solution here.
Couldn't you also add a text box and make the Control Source the combo box. See below as the Control Source:
Column 2 references the column # of the field in the combo box you want to display.
Apr 13 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.