473,553 Members | 3,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why does this work for "resetting" listbox selection?

1 New Member
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
5 3356
twinnyfo
3,653 Recognized Expert Moderator Specialist
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 "deselectin g" 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
220 New Member
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 Recognized Expert Moderator Specialist
Let me get to work on that book!

Thanks for the kind words!
Jun 5 '20 #4
NeoPa
32,564 Recognized Expert Moderator MVP
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
220 New Member
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

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

Similar topics

1
3568
by: Annette Massie | last post by:
I would like to have a form that lists current addresses being used. On this form I would also like to have a command button that would allow the user to add an address if they do not see it listed. Is it possible to have the form show the list box (which is a combinination of the address and city/state/zip), along with the detail fields...
4
11832
by: KK | last post by:
Hi All... For my purpose, I need to handle listbox selection changed event.I must be notified before changing occurs and after.After I can handle using SelectedIndexChanged event.Is there anyway to know which one is selected item before this event.?One thing is I can have a variable to hold the index in my application. I'm looking exactly...
3
3528
by: Alpha | last post by:
I have 3 radio buttons for include, exclued or 'select all' from the listbox items. If a user selects the 'Select All' button' then all items in listbox is hi-lited as selected. Now, when user selects one item out of the 'all selected' listing then there is now only one item selected. How and where can I put in some code to change the...
1
1078
by: VB novice | last post by:
This should be too simple. I want to click on an item populated in a ListBox and have that item appear in a textbox.text field. I can not get the item to appear. The items in the ListBox get there originally through a query generated from a dropdown selection. All the examples I can find on line have not worked. SelectedIndexChanged does...
5
3517
by: Lie | last post by:
Hi all, I have problem in getting selectedindex of multiple listbox selection in a datagrid. I have a listbox with multiple selection mode inside datagrid. In Edit mode, I need to get back all selected items of that listbox and display it. can anyone help? Thanks
3
2410
by: Chris Kettenbach | last post by:
Hello all, Quick question. I have a listbox that is populated by items from a database. When the user select something from the list, I want to populate another listbox based on the selection in the first. Example lstCompany contains a list of company names with the primary key field hidden. After user selects a company, I want to pass that...
5
3584
by: Randy | last post by:
Hi, I'm have a form with a listbox and a few textboxes on it. Based on the user's selection in the listbox, I want the bindingsource to update the textboxes with the corresponding values. I have similar code built for a combobox that works just fine, but when applying it to a listbox bound to a dataview, I can't figure out how to return the...
8
5165
by: NJonge01 | last post by:
Great thanks to all the helpful responses I've read! Recently using MS Access after a lengthy (7-10 years) away from the tool. I apologize for posting a question that for all intents & purposes appears to have been answered several times. Unfortunately, I've tried nearly a dozen approaches that seem to work for others on this board with similar...
1
5155
by: Gerardo ARnaez | last post by:
Hi. I am writing a program to help determine coumadin regimens to look at the code: http://sourceforge.net/projects/coumadinregimen/ The issue is that I have a variable that I want the use to select if they don't like the default. I have made this as a listbox widget The rest of the gui is just entry widgets
5
1789
by: L Ritchie | last post by:
I am using a list box to allow a user to select which region they want to see. My problem is when the user does not make a selection and wants to see all records. This is the statement I'm using as the criteria expression in the Access query. IIf(Not IsNull(!!),(!!),(Like "*"))
0
7568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6109
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5133
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3537
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3525
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1106
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.