PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Delete Single item from multi select listbox

 
 
Asib
Guest
Posts: n/a
 
      18th Dec 2009
Afternoon all. I have searched far and wide for a solution to this. I have an
unbound multi select listbox that i populate with a double click event from a
list of items. I can add things just fine. I can also delete all the items
that i have added to the list box. What i need help on is deleteing a single
item from the listbox on doubleclick. If its easier to simply create a button
that loops through the selected items and deltes them i can do that. But
double clicking seems easier for the users.

lstSelectedItems.RemoveItem (i) This code deletes the first item in the
list. I just need to reference only the item i am double clicking.

Thanks Aasibs.
 
Reply With Quote
 
 
 
 
Daniel Pineault
Guest
Posts: n/a
 
      18th Dec 2009
See http://msdn.microsoft.com/en-us/library/aa221565(office.11).aspx
You simply pass the list box control name and the item number to delete.

Another post that covers the subject can be found at
http://www.bigresource.com/Tracker/Track-vb-Rt80BCvIGM/

Yet another post on the subject can be found at
http://news.office-watch.com/t/n.asp...=978&zoneid=30
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"Asib" wrote:

> Afternoon all. I have searched far and wide for a solution to this. I have an
> unbound multi select listbox that i populate with a double click event from a
> list of items. I can add things just fine. I can also delete all the items
> that i have added to the list box. What i need help on is deleteing a single
> item from the listbox on doubleclick. If its easier to simply create a button
> that loops through the selected items and deltes them i can do that. But
> double clicking seems easier for the users.
>
> lstSelectedItems.RemoveItem (i) This code deletes the first item in the
> list. I just need to reference only the item i am double clicking.
>
> Thanks Aasibs.

 
Reply With Quote
 
Asib
Guest
Posts: n/a
 
      22nd Dec 2009
2 of the links you posted i had already come across. The first microsoft
article i tried to implement, but was unsuccessful because it needs the index
number. I do this in what litle spare time i have and still consider myself a
novice at best. Can i build a string in the double click event of the listbox
to determine the index and then use the function to remove the item? The
second artical drifted off to something that doesnt pertain to my current
situation. And the third i found too indecipherable to do me any good. It was
all based on command buttons and i wasnt sure if the same logic can be
applied to the double click event. Thanks for takin the time to try and help.

"Daniel Pineault" wrote:

> See http://msdn.microsoft.com/en-us/library/aa221565(office.11).aspx
> You simply pass the list box control name and the item number to delete.
>
> Another post that covers the subject can be found at
> http://www.bigresource.com/Tracker/Track-vb-Rt80BCvIGM/
>
> Yet another post on the subject can be found at
> http://news.office-watch.com/t/n.asp...=978&zoneid=30
> --
> Hope this helps,
>
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "Asib" wrote:
>
> > Afternoon all. I have searched far and wide for a solution to this. I have an
> > unbound multi select listbox that i populate with a double click event from a
> > list of items. I can add things just fine. I can also delete all the items
> > that i have added to the list box. What i need help on is deleteing a single
> > item from the listbox on doubleclick. If its easier to simply create a button
> > that loops through the selected items and deltes them i can do that. But
> > double clicking seems easier for the users.
> >
> > lstSelectedItems.RemoveItem (i) This code deletes the first item in the
> > list. I just need to reference only the item i am double clicking.
> >
> > Thanks Aasibs.

 
Reply With Quote
 
Asib
Guest
Posts: n/a
 
      22nd Dec 2009
Disregard the last post. I figured it out. I used this to delete a single
item from the list box.

Call RemoveListItem(lstSelectedItems, lstSelectedItems.ListIndex)

It simply calls the function referenced in your post. I was just having
trouble with the index reference. Thanks again for takin the time to help a
novice.

"Asib" wrote:

> 2 of the links you posted i had already come across. The first microsoft
> article i tried to implement, but was unsuccessful because it needs the index
> number. I do this in what litle spare time i have and still consider myself a
> novice at best. Can i build a string in the double click event of the listbox
> to determine the index and then use the function to remove the item? The
> second artical drifted off to something that doesnt pertain to my current
> situation. And the third i found too indecipherable to do me any good. It was
> all based on command buttons and i wasnt sure if the same logic can be
> applied to the double click event. Thanks for takin the time to try and help.
>
> "Daniel Pineault" wrote:
>
> > See http://msdn.microsoft.com/en-us/library/aa221565(office.11).aspx
> > You simply pass the list box control name and the item number to delete.
> >
> > Another post that covers the subject can be found at
> > http://www.bigresource.com/Tracker/Track-vb-Rt80BCvIGM/
> >
> > Yet another post on the subject can be found at
> > http://news.office-watch.com/t/n.asp...=978&zoneid=30
> > --
> > Hope this helps,
> >
> > Daniel Pineault
> > http://www.cardaconsultants.com/
> > For Access Tips and Examples: http://www.devhut.net
> > Please rate this post using the vote buttons if it was helpful.
> >
> >
> >
> > "Asib" wrote:
> >
> > > Afternoon all. I have searched far and wide for a solution to this. I have an
> > > unbound multi select listbox that i populate with a double click event from a
> > > list of items. I can add things just fine. I can also delete all the items
> > > that i have added to the list box. What i need help on is deleteing a single
> > > item from the listbox on doubleclick. If its easier to simply create a button
> > > that loops through the selected items and deltes them i can do that. But
> > > double clicking seems easier for the users.
> > >
> > > lstSelectedItems.RemoveItem (i) This code deletes the first item in the
> > > list. I just need to reference only the item i am double clicking.
> > >
> > > Thanks Aasibs.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unselect item in single-select listbox bf1@one-point.com Microsoft Access Form Coding 4 3rd Nov 2006 04:39 PM
Deselect last item selected in multi select listbox =?Utf-8?B?TXIgQg==?= Microsoft Access 5 13th Jul 2006 05:07 AM
How do users de-select listbox item in ACCESS, single-choice list =?Utf-8?B?c2tjb21icw==?= Microsoft Access Forms 6 11th May 2005 10:23 PM
Get selected item in multi select listbox Jim Microsoft Dot NET Framework Forms 0 22nd Feb 2005 05:43 PM
Using a multi-select ListBox to delete records =?Utf-8?B?QW5vbnltb3VzZQ==?= Microsoft ADO .NET 3 12th Nov 2004 06:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:16 PM.