Combo Controls

C

Cheswyck

I have a name drop-down which displays 3 seperate fields: Salutation, First
and Last Name. If I select Mr John Doe the result only shows Mr. Do I have
to merge these fields and display them somewhere else?
 
G

Graham Mandeno

Hi Cheswyck

Use a query to combine the three name components into a single string field,
and use that field as the displayed column for your combo box. For example:

SELECT [PersonID],
([Salutation] + " ") & ([FirstName] + " ") & [LastName] as FullName
FROM tblPersons ORDER BY [LastName], [FirstName];

[note the use of brackets and +, versus &, to deal with null fields]

Use this query as the RowSource for your combo box, and set its other
properties as follows:
ColumnCount: 2
BoundColumn: 1
ColumnWidths: 0 (this hides the first column)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top