By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,336 Members | 2,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,336 IT Pros & Developers. It's quick & easy.

clear a multiple list box

P: 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

Nov 13 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

stevenrec wrote:
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.

Nov 13 '06 #2

P: n/a
On 13 Nov 2006 07:57:31 -0800, Tanis wrote:
stevenrec wrote:
>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
Nov 13 '06 #3

P: n/a
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?

Nov 14 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.