Results 1 to 6 of 6

Thread: [RESOLVED] [2005] Filter Combobox Display

  1. #1

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Resolved [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).
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  2. #2
    Fanatic Member Lerroy_Jenkins's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    661

    Re: [2005] Filter Combobox Display

    Silly question, what happens if their are 2 John Does'?
    Lerroy

    "η β π", or "Eta Beta Pi" (Eat A Better Pie)

    01001000
    01000101
    01001100
    01010000


    My Own Code - WordCounter

    Useful Forum Links -Reputation - What is it?

  3. #3

  4. #4
    Lively Member
    Join Date
    Feb 2007
    Posts
    83

    Re: [2005] Filter Combobox Display

    select distinct <John Doe Column> from ....

  5. #5

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: [2005] Filter Combobox Display

    Quote 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.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  6. #6

    Thread Starter
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,748

    Re: [2005] Filter Combobox Display

    Quote 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.
    Quote Originally Posted by Jonga
    select distinct <John Doe Column> from ....
    Thanks to you both! It works!
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width