Combo boxes showing multiple values AFTER selection

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
 
B

Brendan Reynolds

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
 
H

H. Orellana

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
 
H

H. Orellana

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
 
B

Brendan Reynolds

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.
 

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