By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,068 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,068 IT Pros & Developers. It's quick & easy.

why does this work for "resetting" listbox selection?

P: 1
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!

Share this Question
Share on Google+
5 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,482
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

P: 25
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
Expert Mod 2.5K+
P: 3,482
Let me get to work on that book!

Thanks for the kind words!
Jun 5 '20 #4

NeoPa
Expert Mod 15k+
P: 31,761
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

P: 25
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.