Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2006, 03:15 PM
stevenrec
Guest
 
Posts: n/a
Default clear a multiple list box

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
Default 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
Default 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
Default 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?

 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles