logo
search
Others

How to Exclude Selected Employee from Supervisor Combo Box in Access

Elise WilliamsElise Williams Oct 12, 2026 869 views

Question details

The user needs to configure a Microsoft Access form so that the supervisor combo box dynamically excludes the employee currently selected or being edited.

How to Exclude the Selected Employee from an Access Supervisor Combo Box
Product
Microsoft Access
Device & OS
not provided
Scenario
Editing employee records in an Access form where a user must select a supervisor, preventing an employee from being assigned as their own supervisor.
Observed behavior
The supervisor combo box needs to dynamically filter its dropdown list to hide the current employee record being edited.
Before you start

Ensure you have design view access to your Microsoft Access database form and a basic understanding of SQL RowSource properties and VBA event procedures.

Solution 1Recommended

Modify RowSource SQL and Requery via VBA

Dynamically filter the supervisor combo box using SQL to exclude the current Employee ID and use VBA to requery the list when the record changes.

This method ensures that the combo box relies on the form's active record to filter out the current employee. By using the Nz() function, it also prevents errors when creating a new record where the EmployeeID might temporarily be null.

1
Edit the Combo Box RowSource

Open your Access form in Design View, select the Supervisor combo box, and open the Property Sheet. Navigate to the Data tab and edit the RowSource property to include a WHERE clause: WHERE EmployeeID <> Nz(Forms!frmEmployees!EmployeeID,0).

2
Add Requery Code to On Current Event

Switch to the Event tab for the form itself. Click the ellipsis (...) next to 'On Current' to open the VBA editor, and add the code: Me.cboLineManager.Requery.

3
Add Requery Code to After Update Event

Similarly, find the 'After Update' event for the form, open the VBA editor, and add the exact same requery code: Me.cboLineManager.Requery.

4
Save and Test

Save your form and switch to Form View. Verify that the current employee's name no longer appears in the supervisor dropdown list.

Modify RowSource SQL and Requery via VBA
Adjust Object Names: Make sure to replace 'frmEmployees', 'EmployeeID', and 'cboLineManager' with the actual names of your form, field, and combo box controls in your database.
Free Microsoft Office alternative

Looking for a Free, Lightweight Office Suite?

While WPS Office does not include a database management tool like MS Access, it is the perfect free alternative for your daily document, spreadsheet, and presentation needs. It is highly compatible with Microsoft formats and features a familiar, easy-to-use interface.

Fully compatible with Microsoft Word, Excel, and PowerPoint formatsLightweight design that runs smoothly on most devicesFamiliar user interface for a seamless transitionBuilt-in PDF editing and conversion tools for enhanced productivity
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't my Access combo box updating when I move to a new record?

The combo box list is static until it is explicitly requeried. You need to add a Me.YourComboBoxName.Requery command in the On Current event of the form to force it to refresh the data when navigating between records.

What does the Nz() function do in the SQL RowSource?

The Nz() function evaluates an expression and returns a specified value (like 0) if the expression is Null. This prevents errors in your SQL query when you are on a new blank record that does not yet have an EmployeeID.

Can I change the combo box RowSource entirely using VBA?

Yes. In the After Update event of the employee combo box, you can declare a string variable with your complete SQL SELECT statement and assign it to the RowSource property (e.g., Me.cboSupID.RowSource = strSQL).