MS Access: Display two columns in combo-box

user137263 picture user137263 · Aug 1, 2012 · Viewed 17.3k times · Source

Embarrassingly simple question but I can't work it out or find the answer via google.

Got something like this with two colums

contacts dropdown

But when selected it only displays one column, making the information much harder to read/ understand.

contact

Tried changing properties in property sheet (such as column number) but to no apparent effect.

Answer

Fionnuala picture Fionnuala · Aug 1, 2012

It depends to a certain extent on what you are doing, often something like this suits:

SELECT Id, Surname & ", " & Forename from Table

In other words, the bound column is a unique ID and the selection column includes both the surname and forename in a single column.

EDIT based on additional information:

SELECT [Contact].[CID], [Contact].[Csname] & ", " & [Contact].[Cfname] 
FROM [Contact] ORDER BY [CID], [Csname], [Cfname];