how to prevent duplicates in a combobox coming from database in vb6 RRS feed

  • Question

  • hi !

    i am adding records from my access database and put it in a combobox . it was successful but is there a way that can prevent duplcates to add from the combobox?

    please help

    this is my code

    Dim cnview As New ADODB.connection
    Dim rsview As New ADODB.recordset

    Call connection(cnview, App.Path & "\dbEmploymentSystem.mdb", "engman")
    Call recordset(rsview, cnview, "SELECT  * FROM tblReferral ORDER BY Company ASC")

    While rsview.EOF = False
    cmbSort2.AddItem rsview!Company
    Set rsview = Nothing

    hope you can help me

    Monday, September 30, 2013 1:43 AM


All replies