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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Listbox Remove Item
Keith Andersen 
    
2 years ago
I need a Macro - not VBA to remove a listbox selected item.

Is there such a capability in macros?

Also, does anyone know an extensive resource to learn macros?

Much thanks.
John Campbell  @Reply  
     
2 years ago
Hi Keith....

You can do this with a macro by running an update query via the macro.  I would have to have you clarify what you want to remove from the listbox, assuming the list boxes' recordsource is a table.  If you add an Active field to that table that stores the values, then the update query via a macro can set it to Active or InActive.  

Keith Andersen OP  @Reply  
    
2 years ago
Hey John,
I have an equipment table. One field the client can choose a Daily, Weekly or Monthly inspection. I can load an "Inspection Form" where equipment match the inspection designation. A query gathers the matching records.  Rather than simply cycling through the records, I would like to load the equip ID, Make, Model of the matching records into a list box. The client then selects the record which triggers a macro that sets the selected item ID and places it in the form field. Then the form is completed and saved via a button.

It is at this point I would like to remove the item from the list leaving those un-inspected records in the list box.

I am having difficulty envisioning how to accomplish this.
John Campbell  @Reply  
     
2 years ago
Quick question before I can provide more details.  Are the records in the list box coming from a different recordsource than the form you want to add them to?
Keith Andersen OP  @Reply  
    
2 years ago
Yes
John Campbell  @Reply  
     
2 years ago
okay, since you don't want to use VBA, then if we were to use all macros, then that also means we can't write sql in the vba.  
Then you would need the list box on frm1.  When the user selects one of the items in the listbox, then the button would have a macro that runs an append query based on the id.  The query criteria would reference the list box on the frm1.  So Forms![Frm1]![FieldID]. That would send the record to the next form/table. The next step is to get the item out of the list box.  You could then have the next action run a delete query to delete the data record or an update query that sets the line item as "checked" or "Offlist".

These are the general steps.  Without seeing your database, this is the best route to take.  

I have a link on Richards's site as a consultant and my website is there.  If you want more help or details, we could go down this road and reach me directly at [email protected].  Thanks
Keith Andersen OP  @Reply  
    
2 years ago
Hmmm. From your responses ....how about this. On the equipment table have a bolean Yes/No field "Inspected" that is No by default. A query loads all equipment into list box. Upon selecting a record I'm listbox, a macro fires putting equipment ID into. Foreign field of Inspection form thus connecting the records. Finish inspection form and save. Save button triggers macro to update Inspected field on equipment table and then requery listbox and this record would not be included. After all are done, do an update query to reset equipment "Inspected" field to No again. What's your thoughts?
John Campbell  @Reply  
     
2 years ago
Yes, that would probably work if you still want to use macros...

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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: 4/30/2026 8:47:17 AM. PLT: 1s