Combobox Field Combination

D

Dustin Cook

I have a combobox on my form that displays two different columns of
information on drop-down. However, I would like it to display both colums
when it is not dropped-down.

Specifically, I have a combobox named cmbCustomerID. It uses the
CustomerFirstName and CustomerLastName fields from tblCustomers to show two
columns of information (last name then first name) when a user drops down the
box. When they navigate away from the control, it now only displays
CustomerLastName.

If they drop down and select "Smith | Joe" then they only see "Smith" once
it's no longer dropped down. I hope I'm explaining myself well enough here.

Will someone please tell me how to make it display Smith, Joe in the
non-dropped-down control?

By the way, I tried posting this twice with the SQL statement included, but
I got an error each time.
 
M

Mr B

Dustin,

Try:
SELECT tblCustomers.CustomerID, tblCustomers.CustomerLastName & ", " &
tblCustomers.CustomerFirstName as Name FROM tblCustomers ORDER BY
[CustomerLastName],
[CustomerFirstName];
 
S

SteveS

Like Mr B says.... but "Name" is a reserved word in Access.

I would use "... as FullName FROM..."

or

"... as CustomerFullName FROM..."

plus it is more descriptive than "Name"..


my 2 cents worth ;)

--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Mr B said:
Dustin,

Try:
SELECT tblCustomers.CustomerID, tblCustomers.CustomerLastName & ", " &
tblCustomers.CustomerFirstName as Name FROM tblCustomers ORDER BY
[CustomerLastName],
[CustomerFirstName];

--
HTH

Mr B


Dustin Cook said:
I have a combobox on my form that displays two different columns of
information on drop-down. However, I would like it to display both colums
when it is not dropped-down.

Specifically, I have a combobox named cmbCustomerID. It uses the
CustomerFirstName and CustomerLastName fields from tblCustomers to show two
columns of information (last name then first name) when a user drops down the
box. When they navigate away from the control, it now only displays
CustomerLastName.

If they drop down and select "Smith | Joe" then they only see "Smith" once
it's no longer dropped down. I hope I'm explaining myself well enough here.

Will someone please tell me how to make it display Smith, Joe in the
non-dropped-down control?

By the way, I tried posting this twice with the SQL statement included, but
I got an error each time.
 
D

Dustin Cook

Thank you both for your help. This solved my problem.

SteveS said:
Like Mr B says.... but "Name" is a reserved word in Access.

I would use "... as FullName FROM..."

or

"... as CustomerFullName FROM..."

plus it is more descriptive than "Name"..


my 2 cents worth ;)

--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


Mr B said:
Dustin,

Try:
SELECT tblCustomers.CustomerID, tblCustomers.CustomerLastName & ", " &
tblCustomers.CustomerFirstName as Name FROM tblCustomers ORDER BY
[CustomerLastName],
[CustomerFirstName];

--
HTH

Mr B


Dustin Cook said:
I have a combobox on my form that displays two different columns of
information on drop-down. However, I would like it to display both colums
when it is not dropped-down.

Specifically, I have a combobox named cmbCustomerID. It uses the
CustomerFirstName and CustomerLastName fields from tblCustomers to show two
columns of information (last name then first name) when a user drops down the
box. When they navigate away from the control, it now only displays
CustomerLastName.

If they drop down and select "Smith | Joe" then they only see "Smith" once
it's no longer dropped down. I hope I'm explaining myself well enough here.

Will someone please tell me how to make it display Smith, Joe in the
non-dropped-down control?

By the way, I tried posting this twice with the SQL statement included, but
I got an error each time.
 

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