Combo Box Column Count

jdbegg

New member
Local time
Today, 10:36
Joined
Mar 13, 2003
Messages
24
I have searched through most of the threads for an answer and couldn't find an exact answer for my problem.

I have a combo box pulling three columns, Primary Key, Last Name and First Name. The properties box has a column count of 3 with column widths set to 0,1,1. My problem is the combo box will show Last Name and First Name when selected and will allow me to select the record I want from the list. But, once selected, the combo box only shows the Last name. How do I get both Last Name and First Name to display in the combo box column?

Thanks for the help in advance.

JDB
 
You can use a concatenated column. In a query:

FullName: LastName & ", " & FirstName
 
Short answer is, you can't! You can place a textbox next to your combobox and use the AfterUpdate event of the combobox to assign the First Name to it, but I've never personally liked this.

What I do is base the combobox on a query, and in the query create a calculated field. In the Query Design Grid, in a blank field, type in

CompleteName: [LastName] & " " & [FirstName]

Now create your combobox and use your PK and CompleteName. Now after a selection is made you'll have last and first name showing in the combobox.

This also helps if you use the Combobox Wizard to retrieve a record. The Wizard's code uses FindFirst, so if you have LastName and FirstName seperate, the way your combobox was originally set up, when you select anyone with the last name of Jones, Access will always retrieve the first Jones on the list, not necessarily the one you were trying to retrieve. Using CompleteName, as outlined above, will retrieve the correct Jones.

P.S. Bourbon in the afternoon does slow down my typing, Paul!

As for Galt, ask Ayn!
 
You get bourbon in the afternoon? All I've had is a Dr. Pepper with lunch! :p
 
It looks like a consesus to me...it can't be done unless concatenated. Have completed that step, but now I need to figure out how to do a Select Unique as I'm getting multiples in the combo box which I wasn't before with the Last Name, First Name separated. Also the PK is showing in the concat combo box and not the name. I should be able to read help and figure out the solution. Thanks much. JDB
 

Users who are viewing this thread

Back
Top Bottom