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 
How to Delete Employee Name From Drop Down List
Mark Fannin 
      
13 months ago
I have an employee table where I list the employees.  On the order page I reference the employee table from the drop down list.  We have some employees who have left the company.  I don't want the drop down menu to list the old employee.  How do I delete them from the drop down list (or table?) but keep the history for all the past orders and future queries?  PS: I am using index numbers like Richard teaches, so the employee name(s) are in one, and only one employeeT.  Many thanks in advance.
Sami Shamma  @Reply  
             
13 months ago
The best way to deal with this is to add a yes/no field to your employee table. Let's call it "IsActive"
Make the default value "Yes". Now you change this to "No" for all the employees who are no longer in the company.

In the control source of your combo box, add a WHERE condition before the "ORDER BY" so it should look like this:

SELECT EmployeeID, EmployeeName

FROM EmployeeT

WHERE IsActive

ORDER BY EmployeeName;


Now only active employees will show up in the combo box.
Mark Fannin OP  @Reply  
      
13 months ago
Brilliant!  Thank you very much!  All the best to you Sami.
Joe Holland  @Reply  
      
13 months ago
Sami's answer works great for new data entry but you will not be able to see the old employees when you open existing records. I use the NewRecord property when entering data to limit the combobox using SQL. If it is a new record, only show active employees, if not, show all. This way you can see you entered the data originally.
Joe Holland  @Reply  
      
13 months ago
I put this code in the on current event of the form. It controls what is shown in the employee combobox.

If Me.NewRecord Then
        Employee.RowSource = "SELECT [Employee Listing Query].Name, [Employee Listing Query].EmployeeID, [Employee Listing Query].Active FROM [Employee Listing Query] WHERE (([Employee Listing Query].Active)=-1)"
    Else
        Employee.RowSource = "SELECT [Employee Listing Query].Name, [Employee Listing Query].EmployeeID, [Employee Listing Query].Active FROM [Employee Listing Query]"
End If

(I built my database 30 years ago before I knew Richard's naming conventions so my field names have spaces.)
Mark Fannin OP  @Reply  
      
13 months ago
Joe, it works!  Many thanks.  Thanks to everyone for their help.

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: 6/16/2026 7:04:16 PM. PLT: 0s