Combobox filtering Listbox

musclecarlover07

Registered User.
Local time
Today, 04:47
Joined
May 4, 2012
Messages
236
Ok I have a list box (CounselorInitials) and a listbox (AssignedToYou)
The list box has 6 columns and is using a query (AssignedToMe). The important one is the 6th one (Counselor). All working off a table called DityLog.

I want to select initals in the combo box and then it will filter the listbox and only show records that are the same.
So if I select initals MC from the combo box I want the Listbox to show all records that have the initals with MC.
 
Open your query that is providing the row source for your list box in design view, right click in the criteria row of the field that holds the initials and use the Build option to add a reference to the "CounselorInitials" combo box as the criteria. When you have finished providing the reference it should look something like the following except the "NameOfYourForm" would be the actual name of your form:
Forms!NameOfYourForm.CounselorInitials

Then in the "After Update" event of your combo box add the following line of VBA code:
Code:
Me.AssignedToMe.Requery

Adding this VBA code will update your listbox when you make a selection from your combo box.
 

Users who are viewing this thread

Back
Top Bottom