Sorting a Lookup Box

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).
 
S

Sandra Daigle

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;
 

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