Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Unselecting a List Box
Launa Sallai 
     
3 years ago
Good Morning,
I have a form that has a list box.  I also have a button to clear the selections.  I want to clear the list box so nothing is selected, and have searched everywhere and everything that is suggested does not work, or I am doing something wrong.  I want to click on the Clear search button and have the list box unselected and brought back to the first row.  The list box is data from a table, that users can search and filter the rows.  Anyone know how I can do this?
Launa Sallai OP  @Reply  
     
3 years ago

Launa Sallai OP  @Reply  
     
3 years ago
When I clear I would like no selection on the listbox and no black line, that is my goal.  Thanks for your help!
Kevin Robertson  @Reply  
          
3 years ago
You can set the selected item to False. This will not clear the value so also set to Null.

For example:
lstCustomers.Selected(lstCustomers.ListIndex) = False
lstCustomers = Null


Note: just setting the list box to Null should also work (just showing you a couple of methods to deselect the selected item).
Launa Sallai OP  @Reply  
     
3 years ago

Launa Sallai OP  @Reply  
     
3 years ago
The one highlighted worked for me, thank you Kevin.  The other one did nothing.  But it does not bring me back to the first row.  but glad to get rid of the black line now and have it unselected.  I've been searching this for months.  As I've been working on 4 different search pages all very similar to this one, and never could get the listbox unselected.  If you know how to get me back to the first row, it is ordered desc?
Kevin Robertson  @Reply  
          
3 years ago
To select the first row of a List Box:

Normally it would be this:
lstCustomers = lstCustomers.ItemData(0)

But since you have Column Headers turned on for your List Box, use this:
lstCustomers = lstCustomers.ItemData(1)
Launa Sallai OP  @Reply  
     
3 years ago
Thank you very much for your help Kevin!

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 6:30:11 PM. PLT: 1s