Combo Box Can not filter by user Name

osimini

New member
Local time
Today, 07:36
Joined
Aug 23, 2001
Messages
7
I have Combo box in a form as a search criteria to pull customer information from the tblCustomers and populate the form. The combo box populates the customer names and works as required. But my problems now is how to filter the combo box to populate only the customer assign to a particular employee. For example, I have a table called tblUsers with userID, UserName and UserType.

Here is the code I used to populate the combo box with the customer names.
Private Sub cboSelect_AfterUpdate()
' Find the record that matches the control.
Me.RecordSource = "SELECT * FROM tblCustomer WHERE CustomerID = " & Me.cboSelect
End Sub

Based on the information above is there any way to twick the code to accomplish to do this. Please note that the main form is bound to tblCustomers
 
You need to have the employee id stored in tblCustomer.
and then set the cboSelect source to
Select tblCustomer.CustomerID FROM tblCustomerID WHERE EmployeeID = 6

thats one way of doing it
 

Users who are viewing this thread

Back
Top Bottom