I have a form that has a listbox on it. I have a Reset Button on it for the
user to click if they want a to clear the form in order to start an entry
from scratch.
The Button works to clear the form with the exception of deselecting any
items that were previously selected by the user in the listbox. The items
that were previously selected by the user remain. The only way to rid the
selection is for the user to deselect each one.
Anybody got a simple solution for this one? It has to have been done
already though my searches did not turn up much.
Ofer - 01 Sep 2005 00:11 GMT
Run this code to unselect all records in the list
For i = 0 To ListBoxName.ListCount - 1
ListBoxName.Selected(i) = false
Next i
To select all the records just change it form false to true
> I have a form that has a listbox on it. I have a Reset Button on it for the
> user to click if they want a to clear the form in order to start an entry
[quoted text clipped - 6 lines]
> Anybody got a simple solution for this one? It has to have been done
> already though my searches did not turn up much.
cyberarf - 01 Sep 2005 17:09 GMT
Ofer,
Thanks for your help. Your code worked fabulously. Thanks again - cyberarf
> Run this code to unselect all records in the list
>
[quoted text clipped - 14 lines]
> > Anybody got a simple solution for this one? It has to have been done
> > already though my searches did not turn up much.
Ofer - 01 Sep 2005 00:13 GMT
One more thing, declare the I before running the loop
Dim I as Integer
> I have a form that has a listbox on it. I have a Reset Button on it for the
> user to click if they want a to clear the form in order to start an entry
[quoted text clipped - 6 lines]
> Anybody got a simple solution for this one? It has to have been done
> already though my searches did not turn up much.