Full Version: Empty a Listbox
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
jmbro10
Hi, is there a quick way to clear a listbox w/value list? I see how to use removeitem on a selected item but how can I just quickly clear it?
Thanks!
Jack Cowley
Me.ListBoxName.RowSource = ""

I assume you want to remove the values and not just clear the selected items in the list box...

hth,
Jack
accesshawaii
If you're trying to clear all the selections on a multi-select list box, you can do the following.

CODE
Dim x As Integer

'ABC Code
For x = 0 To MyListBox.ListCount - 1
    MyListBox.Selected(x) = False
Next x
jmbro10
Thanks so much! too simple!
Jack Cowley
You are welcome.... I am NOT a fan of value lists, as I prefer to use tables. If, of course, you are building your list box on the fly then you approach may be more advantages...

Jack
accesshawaii
You're welcome.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.