By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,345 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

Display full name in combo box

P: n/a
hey, guys,

I have a simple question --- simple only for you. I created a combo box
called "pick up a name". And the underlying table has lastname and
firstname columns. The full name can be showed in the pull down menu
because in the raw source I use something like"select xx.last_na,
selctxx.first_na from xx" but after click on the pull down menu, only
the last name showed in the box instead of full name. How to show the
full name in the box? I need that value to select another form. Thanks
a lot.

Mindy

Dec 8 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You can concatenate the 2 fields into one.

This example shows Surname first:
SELECT ClientID, Surname & ", " + Firstname AS FullName
FROM tblClient ORDER BY Surname, Firstname;

This one shows Firstname first:
SELECT ClientID, FirstName + " " & Surname AS FullName
FROM tblClient ORDER BY Firstname, Surname;

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mindy" <ma************@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

I have a simple question --- simple only for you. I created a combo box
called "pick up a name". And the underlying table has lastname and
firstname columns. The full name can be showed in the pull down menu
because in the raw source I use something like"select xx.last_na,
selctxx.first_na from xx" but after click on the pull down menu, only
the last name showed in the box instead of full name. How to show the
full name in the box? I need that value to select another form. Thanks
a lot.

Mindy

Dec 8 '05 #2

P: n/a
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in
news:43***********************@per-qv1-newsreader-01.iinet.net.au:
You can concatenate the 2 fields into one.

This example shows Surname first:
SELECT ClientID, Surname & ", " + Firstname AS FullName
FROM tblClient ORDER BY Surname, Firstname;


This one will display ", Firstname" when there is no Surname.

I use the clever Mid() trick that, I believe, Trevor Best suggested:

Mid(("12"+Surname) & (", "+Firstname), 3)

that works in all cases.

For the other order, I just use Trim(Firstname & " " & Surname), but
your example is more efficient, as it doesn't need to call Trim().

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Dec 8 '05 #3

P: n/a
Thanks

Dec 9 '05 #4

P: n/a
Thanks

Dec 9 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.