Want combo box to display multiple columns from separate table

gbuckton

Registered User.
Local time
Today, 00:08
Joined
Aug 20, 2008
Messages
38
I have the following code so my Combo box displays all of the values in a column from another table (table = Observer):

Row Source:
SELECT DISTINCT Observer.ObserverID FROM Observer;

this works great, however, I'd like my combo box to display 2 columns - the values from 2 different columns of the Observer table.

I know I need to set my Column Count to 2 (for 2 columns), but I've tried using the code:

Row Source:
SELECT DISTINCT Observer.ObserverID FROM Observer; SELECT DISTINCT Observer.LastName FROM Observer;

and it's not working.

any suggestions?
 
Code:
SELECT Observer.ObserverID, Observer.LastName FROM Observer;

Make sure to set your column widths appropriately, and set the "bound" column too.
 
It would be something like:

SELECT DISTINCT Observer.ObserverID, Observer.LastName FROM Observer;

You would also need to set the column widths property of the combo. Be aware that properly set, the combo will display both columns when dropped down, but it will not display both columns once a selection has been made.
 

Users who are viewing this thread

Back
Top Bottom