Select duplicate names from listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jerrys57
    New Member
    • Oct 2007
    • 3

    #1

    Select duplicate names from listbox

    Hi All,
    Need some help with a listbox display to textbox...After loading my listbox from the database, I need to be able to select duplicate names and display them in a textbox....it works fine on the first name but if there is a duplicate last name it still displays the first one no matter which one you click.....below is the code I am trying to use.......Pleas e any help would be appreciated.... ....

    Set RS = db.OpenRecordse t("Select * from retmem where [lname] = '" & Trim(list1.list (list1.ListInde x)) & "'")

    txtfirst.Text = RS("fname")
    txtlast.Text = RS("lname")
  • gilsygirl
    New Member
    • Sep 2007
    • 25

    #2
    Originally posted by jerrys57
    Hi All,
    Need some help with a listbox display to textbox...After loading my listbox from the database, I need to be able to select duplicate names and display them in a textbox....it works fine on the first name but if there is a duplicate last name it still displays the first one no matter which one you click.....below is the code I am trying to use.......Pleas e any help would be appreciated.... ....

    Set RS = db.OpenRecordse t("Select * from retmem where [lname] = '" & Trim(list1.list (list1.ListInde x)) & "'")

    txtfirst.Text = RS("fname")
    txtlast.Text = RS("lname")

    Hi Jerry

    Have u tried using the SEEK Method where u can specifically search the field from the database base on its index.

    Good luck

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      Try to use DISTINCT or UNIQUE key word in the SQL statment to filter the duplicate values.

      Comment

      • jerrys57
        New Member
        • Oct 2007
        • 3

        #4
        Originally posted by gilsygirl
        Hi Jerry

        Have u tried using the SEEK Method where u can specifically search the field from the database base on its index.

        Good luck
        Thank you, but I am not sure of the code format for the seek with index, do you have an example ..thanks so much........Jer ry

        Comment

        Working...