Connecting Tech Pros Worldwide Help | Site Map

clear a multiple list box

  #1  
Old November 13th, 2006, 03:15 PM
stevenrec
Guest
 
Posts: n/a
Probably very easy question.

I have a list box and have selected several items.
I then create table entries for each item selected.
the list box 'contents' gets smaller since there are less things to
choose.

but the marked 'areas' of the list box are still marked.
how can I get the list box to have nothing selected?

everything I have tried brought the 'invalid use' error

thanks for any help you can provide.

steven

  #2  
Old November 13th, 2006, 03:35 PM
Tanis
Guest
 
Posts: n/a

re: clear a multiple list box



stevenrec wrote:
Quote:
Probably very easy question.
>
I have a list box and have selected several items.
I then create table entries for each item selected.
the list box 'contents' gets smaller since there are less things to
choose.
>
but the marked 'areas' of the list box are still marked.
how can I get the list box to have nothing selected?
>
everything I have tried brought the 'invalid use' error
>
thanks for any help you can provide.
>
steven
click on the row again to deselect it.

  #3  
Old November 13th, 2006, 05:05 PM
fredg
Guest
 
Posts: n/a

re: clear a multiple list box


On 13 Nov 2006 07:57:31 -0800, Tanis wrote:
Quote:
stevenrec wrote:
>
Quote:
>Probably very easy question.
>>
>I have a list box and have selected several items.
>I then create table entries for each item selected.
>the list box 'contents' gets smaller since there are less things to
>choose.
>>
>but the marked 'areas' of the list box are still marked.
>how can I get the list box to have nothing selected?
>>
>everything I have tried brought the 'invalid use' error
>>
>thanks for any help you can provide.
>>
>steven
click on the row again to deselect it.
You can add a command button and use it's click event:

Dim varItem As Variant
For Each varItem In ListBoxName.ItemsSelected
ListBoxName.Selected(varItem) = False
Next varItem

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #4  
Old November 14th, 2006, 08:05 AM
stevenrec
Guest
 
Posts: n/a

re: clear a multiple list box


Works great,

makes sense to use the same idea to reset it.
Have been playing with other properties today trying to check if it is
now empty, so it would close the form if there is nothing more to
click.
Pretty simple- just use the listcount property.

Now going to find a way to check the list before the form is shown. If
I try to open the form, would like a message that there is nothing to
display, instead of showing an empty form. Would it be real slow to
open it hidden, set the on open property to check it, and if it is not
empty change to visible, or if empty then a message?

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Selct List Box Problems Aric Green answers 7 January 25th, 2008 04:45 PM
php/mysql multiple select list box(beginner). sathyashrayan answers 2 May 10th, 2007 11:15 PM
multi line list box Muhammad Ahsin Saleem answers 3 September 25th, 2006 11:45 AM
Please help to limit number of selections in multiple select list box Paul answers 29 July 20th, 2005 03:06 PM