A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Deselect All in List Box



 
 
Thread Tools Display Modes
  #1  
Old December 31st, 2009, 09:47 PM posted to microsoft.public.access.forms
Pamela
external usenet poster
 
Posts: 193
Default Deselect All in List Box

I have a multi-select List Box on my form. Is there a way for the user to
Deselect All if they make a mistake and click on an Item in the box? I just
made the mistake myself in trial and while I can change the Item(s) selected,
I'm not being able to deselect all. Thanks so much!

Pamela
  #2  
Old December 31st, 2009, 10:17 PM posted to microsoft.public.access.forms
Beetle
external usenet poster
 
Posts: 1,254
Default Deselect All in List Box

See this link;

http://allenbrowne.com/func-12.html

Also, you may want to bookmark Allen Brown's website.
There are a lot of useful tips, procedures, functions etc.

--
_________

Sean Bailey


"Pamela" wrote:

I have a multi-select List Box on my form. Is there a way for the user to
Deselect All if they make a mistake and click on an Item in the box? I just
made the mistake myself in trial and while I can change the Item(s) selected,
I'm not being able to deselect all. Thanks so much!

Pamela

  #3  
Old January 1st, 2010, 02:10 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Deselect All in List Box

Here's one that clears a listbox on one of my forms:

Dim varItem As Variant

For Each varItem In Me.lstElevation.ItemsSelected
Me.lstElevation.Selected(varItem) = 0
Next varItem
Me.lstElevation.Requery

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Pamela" wrote in message
...
I have a multi-select List Box on my form. Is there a way for the user to
Deselect All if they make a mistake and click on an Item in the box? I
just
made the mistake myself in trial and while I can change the Item(s)
selected,
I'm not being able to deselect all. Thanks so much!

Pamela



  #4  
Old January 1st, 2010, 05:04 PM posted to microsoft.public.access.forms
Pamela
external usenet poster
 
Posts: 193
Default Deselect All in List Box

Thanks, Guys! I was getting ready to test it out when I found that if I
simply hold down Ctrl as I click even the last item in the box that it will,
indeed, deselect all. When I tried it before, I was just single clicking.

Thanks!

"Arvin Meyer [MVP]" wrote:

Here's one that clears a listbox on one of my forms:

Dim varItem As Variant

For Each varItem In Me.lstElevation.ItemsSelected
Me.lstElevation.Selected(varItem) = 0
Next varItem
Me.lstElevation.Requery

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Pamela" wrote in message
...
I have a multi-select List Box on my form. Is there a way for the user to
Deselect All if they make a mistake and click on an Item in the box? I
just
made the mistake myself in trial and while I can change the Item(s)
selected,
I'm not being able to deselect all. Thanks so much!

Pamela



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.