I link up a combobox item with a MS access database by setting the data source and display member of combobox properties. However, I wish to filter some repeated item in the combobox, how can I do that?

For example, my MS access table contain value as follow:

profile name| Operator| wallpaper
1.MotoZ8 | Singtel | water lilies
2.MotoZ8 | StarHub | Sunset
3.MotoZ10 | Singtel | blue hills

after set the data source and display member(profile name) of my combobox to link up with the MS access table, now my combobox display the following item :MotoZ8,MotoZ8 and MotoZ10.

Now the problem is I can't filter away the repeated item, I wish my combobox only display distinct item,in this case only display MotoZ8 and MotoZ10. How can I do this? I m using Visual C++ 2005 express edition.

Pls help me. Million thanks.



10 Years
Discussion Span
Last Post by Ancient Dragon

Instead of doing a direct link with the database why don't you write an SQL query in which you can filter the data any way you want then fill the combo box with the result set.
SELECT DISTINCT profile_name will remove duplicates

Edited by Dani: Formatting fixed

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.