Combo Box Help

  • Thread starter Thread starter Terry Kemmerer
  • Start date Start date
T

Terry Kemmerer

I have created a form that accesses a customer database with the usual type
of information in it, First Name, Last Name, Address etc.

I am trying to create a form that will access that database and display the
Last Name and First Name into one field called Customer name. In the row
source I have the following query,
SELECT Customers.LastName, Customers.FirstName FROM Customers ORDER BY
Customers.LastName, Customers.FirstName;

When you open the combo box it shows both the last and first name in the
drop down. When I select the name the drop down list closes and only the
first column (lastname) is display on the form. Why doesn't it show both
names? The book that I have does not get into the sql stuff.

Thanks
Terry
 
Try this.
SELECT [Customers].[LastName] & " " & [Customers].
[FirstName] AS customerName FROM Customers ORDER BY
[Customers].[LastName]
Then, in the Control Source of Combo box property, select
customerName from the drop down list.
 
Thanks, that corrected the problem.

Also, could you or anyone recommend a book that goes into this type of
detail? The book I have just covers the basics.

Terry
tomato said:
Try this.
SELECT [Customers].[LastName] & " " & [Customers].
[FirstName] AS customerName FROM Customers ORDER BY
[Customers].[LastName]
Then, in the Control Source of Combo box property, select
customerName from the drop down list.
-----Original Message-----
I have created a form that accesses a customer database with the usual type
of information in it, First Name, Last Name, Address etc.

I am trying to create a form that will access that database and display the
Last Name and First Name into one field called Customer name. In the row
source I have the following query,
SELECT Customers.LastName, Customers.FirstName FROM Customers ORDER BY
Customers.LastName, Customers.FirstName;

When you open the combo box it shows both the last and first name in the
drop down. When I select the name the drop down list closes and only the
first column (lastname) is display on the form. Why doesn't it show both
names? The book that I have does not get into the sql stuff.

Thanks
Terry


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 9/17/2004


.
 
Back
Top