|
-
Apr 23rd, 2008, 03:32 AM
#1
Thread Starter
PowerPoster
[RESOLVED] [2005] Filter Combobox Display
Hi! I have table containing name of the student and its enrolled subjects.
John Doe Eng1
John Doe Mat1
John Doe Sci1
John Doe P.E.1
I can already display names in the combobox, problem is if the name john doe appears in the table 4x then it will also appear 4x in the combobox. How do i filter it so that combobox will only display the name once. I am using IDNumber as primary in my table (sql).
-
Apr 23rd, 2008, 03:42 AM
#2
Fanatic Member
Re: [2005] Filter Combobox Display
Silly question, what happens if their are 2 John Does'?
-
Apr 23rd, 2008, 03:43 AM
#3
Re: [2005] Filter Combobox Display
Can you pls post your sql query here? It seems that you have not written DISTINCT in your sql query.
-
Apr 23rd, 2008, 06:12 AM
#4
Lively Member
Re: [2005] Filter Combobox Display
select distinct <John Doe Column> from ....
-
Apr 23rd, 2008, 08:38 PM
#5
Thread Starter
PowerPoster
Re: [2005] Filter Combobox Display
 Originally Posted by Lerroy_Jenkins
Silly question, what happens if their are 2 John Does'?
It may seem silly to you but not for me. What I am doing it here is a registration program where I register the subjects enrolled by a certain students. I have a masterfile containing all the students info. I retrieve student's name and select a student's year level from a combobox and base on the yearlevel all the subjects corresponding for that year level will be displayed in a datagridview from there I click save button to store all records to a table (sql) and since a certain student has 1 or more subjects I get multiple John Does' in my table.
I hope this explain why it's not a silly question.
-
Apr 23rd, 2008, 08:44 PM
#6
Thread Starter
PowerPoster
Re: [2005] Filter Combobox Display
 Originally Posted by Deepak Sakpal
Can you pls post your sql query here? It seems that you have not written DISTINCT in your sql query.
 Originally Posted by Jonga
select distinct <John Doe Column> from ....
Thanks to you both! It works!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|