Combobox Field Combination

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Dustin,

Try:
SELECT tblCustomers.CustomerID, tblCustomers.CustomerLastName & ", " &
tblCustomers.CustomerFirstName as Name FROM tblCustomers ORDER BY
[CustomerLastName],
[CustomerFirstName];
 
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.
 
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.
 
Back
Top