Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Avoid duplicates in ComboBox? 2

Status
Not open for further replies.

utc13

Programmer
Oct 25, 2001
43
US
I have a field in which I would like to provide a combo box which lists all of the values (choices) that have been previously entered for that field (i.e. the user can enter anything they want but I would like to provide them with an easy combo box that lists the other values already stored in that particular field and table). If I just use a simple SELECT statement in the RowSource property such as…

SELECT cboFieldInQuestion FROM tblTableInQuestion;

then the combo box lists all the values already in that table field but it also lists all the duplicates as well.

Is there a way to do this but without showing the duplicates?
 
Hiya,

Go into the SQL View (right-click on the title when you have the query open) and insert 'DISTINCT' straight after the 'SELECT' key word.

That should do it.

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
SELECT DISTINCT .... Maq [americanflag]
<insert witty signature here>
 
Thanks guys! Works perfect! You guys are great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top