Prevent Coping/Transffering item twice from Listbox1 to Listbox2

K

K

Hi all, I am coping/transffering items from listbox1 to listbox2.
how can I prevent coping/transffering item twice by code. I want some
kind of code which popup message saying "You already have copied this
item" etc. Please can any friend can help
 
O

Onur Güzel

Hi all,  I am coping/transffering items from listbox1 to listbox2.
how can I prevent coping/transffering item twice by code.  I want some
kind of code which popup message saying "You already have copied this
item" etc.  Please can any friend can help

Something like:

'untested
If Listbox2.Items.Contains _
(Listbox1.SelectedItem) = True Then
Msgbox("You have already added this to Listbox2!")
End If

When user selects any item in Listbox1 to add Listbox2, if item exists
already, Msgbox will appear.

HTH,

Onur Güzel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top