Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / September 2005

Tip: Looking for answers? Try searching our database.

Clear items selected in a listbox witha Reset Button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cyberarf - 31 Aug 2005 22:19 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.