Sort and omit duplicates in Combo box

  • Thread starter Thread starter ehale
  • Start date Start date
E

ehale

Hello. I have a combo box on a form that refers to Policy
#s in a table. A report is generated showing all claims
pertaining to the policy # selected in the combo box. I'm
having trouble sorting the policy #s in the combo box and
preventing duplicates from showing. Any ideas? Your help
is very appreciated! Thanks
 
Make sure the Row Source for the combo box is a query. Sorting is done in
the query. In the query click on View, then SQL View. Add the word DISTINCT
after the word SELECT. That should prevent duplicates.

Con Giacomini
 
It worked! Thanks a lot!
-----Original Message-----
Make sure the Row Source for the combo box is a query. Sorting is done in
the query. In the query click on View, then SQL View. Add the word DISTINCT
after the word SELECT. That should prevent duplicates.

Con Giacomini





.
 
Base the combo box rowsource upon a query (or SQL).
Sort the query PolicyNo field ascending.
Select only distinct records.

SELECT DISTINCT YourTable.PolicyNo FROM YourTable ORDER BY
YourTable.PolicyNo;

Change the Field and Table names as needed.
 
Back
Top