Sorting a Lookup Box

  • Thread starter Thread starter L. Woodhouse
  • Start date Start date
L

L. Woodhouse

Thanks for the reply earlier Sandra and I have changed my
field names.

I finally got it working right but now have another challenge.

I have a database of 500 customers in a customer database.
My lookup box in my order entry screen lists them in order
by the primary key. How can I get the lookup box to sort by
last name (which may not be unique).
 
Assuming that you are using a RowSource query for the listbox, just use an
Order By clause on the query. Open the query using the build button next to
the RowSource property of the combo. Then in the column for the LastName
field, add Ascending in the sort Field. The resulting query should look
something like this:

SELECT customers.Custid, customers.CustLastName, Customers.FirstName
FROM customers
ORDER BY customers.CustLastName;
 
Back
Top