469,921 Members | 2,152 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,921 developers. It's quick & easy.

why does this work for "resetting" listbox selection?

on another post
https://bytes.com/topic/access/answe...value-list-box
this solution for un-selecting a listbox selection is offered and works just fine.

"You'll have to add a [Reset] button with the command:
Me!Listbox1 = ""
for the first listbox, etc."

But why? What is the technical VBA reason for this? I don't see any mention of that syntax in any documentation that I have.
May 28 '20 #1

✓ answered by twinnyfo

fhinchliffe,

Welcome to Bytes!

Good Question!

A list box can hold a value. That value is based upon the selection within the list box. It can also hold several values. When someone selects one of the list items, the value of the list box control changes to the selection.

When we reset the value of the List box back to "", what we are doing is "deselecting" all the items in the list.

In one sense, this is not a "required" step, as long as we don't try to use the value of the list box again. However, if we want to start with a "clean slate," if you will, you will have to set the value of the list box back to "".

Now, back to the original post you referenced, this is exactly with the OP needed: a way to "deselect" values in the list box. But, yes, I would agree that there is no documentation to do this on MS's site.

Hope this hepps!

5 2711
twinnyfo
3,653 Expert Mod 2GB
fhinchliffe,

Welcome to Bytes!

Good Question!

A list box can hold a value. That value is based upon the selection within the list box. It can also hold several values. When someone selects one of the list items, the value of the list box control changes to the selection.

When we reset the value of the List box back to "", what we are doing is "deselecting" all the items in the list.

In one sense, this is not a "required" step, as long as we don't try to use the value of the list box again. However, if we want to start with a "clean slate," if you will, you will have to set the value of the list box back to "".

Now, back to the original post you referenced, this is exactly with the OP needed: a way to "deselect" values in the list box. But, yes, I would agree that there is no documentation to do this on MS's site.

Hope this hepps!
May 28 '20 #2
SwissProgrammer
213 128KB
This has got nothing to do with anything. Just a comment. After reading some of his previous posts, now when I see that twinnyfo has posted, I generally read it and look diligently for what I can learn from his answer.

I do not know who twinnyfo is but if that person wrote a book and I found out about it, I think that I would buy it now.
Jun 5 '20 #3
twinnyfo
3,653 Expert Mod 2GB
Let me get to work on that book!

Thanks for the kind words!
Jun 5 '20 #4
NeoPa
32,231 Expert Mod 16PB
I'll second that. He has a patient style and explains what he's doing and why. This is so helpful for those that want to learn and progress. Thumbs up for Twinny :-)
Jun 5 '20 #5
SwissProgrammer
213 128KB
Each of you, and some others that I have been reading on this site: As long as most of the book is about your experiences with programming (nothing secret of course) covering your choice of programming language(s) and programming applications (Data Bases, Industrial applications, Stand-alone executables, etc.). A 200 to 300 page book: like an autobiography, but having to do with your life in programming, from when you started until now. I can offer $0.50 per page.

I have 5 intense books on C++ programming that I special ordered, and I have received, I guess, maybe 20 or more times more from people like you.
Jun 6 '20 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Annette Massie | last post: by
1 post views Thread by VB novice | last post: by
3 posts views Thread by Chris Kettenbach | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.