Sort and omit duplicates in Combo box

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
 
C

Con Giacomini

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
 
E

erica

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





.
 
F

Fredg

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.
 

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

Similar Threads


Top