sort lookup by alphabet

  • Thread starter Thread starter Chink!
  • Start date Start date
C

Chink!

'ello

I created a form with a lookup field which lets you select records from the
table quickly

Is there a way to sort the lookup list into alphabetical order?

At the moment it is sorting by an ID number attached to each record.


many thanks
CH!
 
Use as query (or SQL statement) as the RowSource for your lookup, e.g.:
SELECT ClientID, ClientName FROM ClientTable ORDER BY ClientName;
 
Thanks for your reply
Would you mind explaining how to do this?
Ive located the RowSource parameter in the Lookup Properties

The main table is called Staff
The fields are Surname and FirstName
I'd like to see both in the Lookup sorted by the Surnames in alphabetical
order

thanks
CH!
 
1. Create a query that displays the correct fields (probably the ClientID
first, and then Suranme and Firstname), and sorts correctly.

2. Save the query.

3. Open the table and replace the SQL statement with the name of the query.

BTW, many of us hate the use of the lookup field within the table like that,
because it obfuscates what is actually being stored there, and the wizard
has other bad side effects. Details in this article:
The Evils of Lookup Fields in Tables
at:
http://www.mvps.org/access/lookupfields.htm
 
Back
Top