De-Select ListBox item (1 Viewer)

jjturner

Registered User.
Local time
Today, 08:40
Joined
Sep 1, 2002
Messages
386
I must've gone brain-dead because I can't figure out how to De-select a selected item in a listbox through code (so no items are selected in the listbox).

Tried the Selected property, ListIndex property, ItemsSelected property. What am I missing?

Thanks in advance,
John
 

Rakier

Registered User.
Local time
Today, 08:40
Joined
Mar 21, 2002
Messages
75
You can set the value of the listbox to an empty string. That will clear the value.

me.YourListBoxName.value = ""

That should work.

HTH
 

jjturner

Registered User.
Local time
Today, 08:40
Joined
Sep 1, 2002
Messages
386
Rakier

Yup - that's it

Thank You!
Thank You!

PS - Bill the Cat for Pres!
 

WayneRyan

AWF VIP
Local time
Today, 08:40
Joined
Nov 19, 2002
Messages
7,122
John,

Dim ptr As Long

For ptr = 0 To Lister.ListCount - 1
Me.Lister.Selected(ptr) = False
Next ptr

That will clear them all.

Wayne
 

jjturner

Registered User.
Local time
Today, 08:40
Joined
Sep 1, 2002
Messages
386
Wayne,

Good point - if listbox is MultiSelect, only your solution works. And the Selected property was what I originally tried in the first place! :mad:

Well, just goes to show how muddled my head gets when under a project deadline (gotta stay frosty) . . .

Thanks for the sanity check!

Regards,
John
 

Users who are viewing this thread

Top Bottom