locked
Stop ListBox duplicates by using items.contains - Problem RRS feed

  • Question

  • User-858460272 posted

    Hi,

    I have a simple sytem where i am adding an equipment to a listbox when it is selected from a drop-downlist. The list populates the different equipment selected by the user. However, i want to stop the user from adding teh same equipment twice in the listbox - stop duplicates. I tried usin the following code but it did not work: 

    If Not (Me.lstEquipmentId.Items.Contains(Me.txtEquipment.SelectedItem)) Then

    ------

    End if

    The contains function seems to be the function i want to use but i'm not sure how to. Can anyone help?

    Regards,

    Shuja

    Wednesday, September 10, 2008 6:46 AM

All replies