We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,440 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Combo box issues

Hey guys

im populating a combo box from my database i was just wondering how do i prevent the combo box from displaying different instances of the same value. e.g three B&Bs all from ennis. ennis is in the combobox but its displayed three times.

how do i stop this ??

Thanks

4
Contributors
4
Replies
1 Hour
Discussion Span
3 Months Ago
Last Updated
18
Views
joseph.lyons.754
Newbie Poster
22 posts since Mar 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Show the query you use to retrieve the values (and some sample data would be helpful too).

pritaeas
Posting Prodigy
Moderator
9,546 posts since Jul 2006
Reputation Points: 1,194
Solved Threads: 1,495
Skill Endorsements: 98

I agree with @pritaeas but off the top of my head, use DISTINCT in your query to only retrieve one instance of the same value.

simplypixie
Practically a Master Poster
642 posts since Oct 2010
Reputation Points: 157
Solved Threads: 118
Skill Endorsements: 5

Thanks Guys Distinct srted it

joseph.lyons.754
Newbie Poster
22 posts since Mar 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

You can use distinct or Group BY, either of that works.

szabizs
Junior Poster
150 posts since Jul 2009
Reputation Points: 8
Solved Threads: 21
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0670 seconds using 2.7MB