Combo boxes showing multiple values AFTER selection

  • Thread starter Thread starter H. Orellana
  • Start date Start date
H

H. Orellana

Hi everybody. I've done extensive searching and I know that a combobox
can show multiple fields in the selection pulldown. For example, if I
have a combobox allowing you to choose a person, the pulldown shows the
FirstName and LastName, but internally it stores the UserID of that
person. My problem is that I want the box to display the FirstName and
LastName in the box *after* the person is chosen.

Does anyone have any idea how to do this?

Thanks
Enrique
 
Concatenate the two field in the query or SQL statement you use as the Row
Source of the combo box. For example ...

SELECT UserID, FirstName & " " & LastName FROM tblUsers
 
Brendan said:
Concatenate the two field in the query or SQL statement you use as the Row
Source of the combo box. For example ...

SELECT UserID, FirstName & " " & LastName FROM tblUsers
Hi Brendan.

Will this not store the concatenated string in the field assigned to the
combobox? I need it to store the ID foreign key, not the
FirstName+LastName fields.

Thanks,
Enrique
 
Brendan said:
Concatenate the two field in the query or SQL statement you use as the Row
Source of the combo box. For example ...

SELECT UserID, FirstName & " " & LastName FROM tblUsers

Brendan, thanks alot for your help. I tested it and my concern was
unfounded. What you wrote above works perfectly.

Thanks again for your help,
Enrique
 
No.

This SQL statement returns two columns, UserID, and the concatenated full
name. Assuming that the Bound Column property has not been changed from the
default of 1, the value of the combo box will be the value of the first
column, UserID.
 
Back
Top