can samebody help me with this simple problem.
I have 2 datalist and 2 ADO control in my program. the first datalist is name DATABRANCH and second is DATAEMPLIST. ADO control name AdoEmployee for employee table and AdoBranch for table branch.

I want to filter the employee name by branch.

i set the ADO control to this...

DATABRANCH rowsource is ADOBRANCH and ListField is branch_nm
DATAEMPLIST rowsource is ADOEMPLIST


Can someone help me with this.....

Thanks....


Here is my code...

Option Explicit
Dim branchQuery As String


Private Sub Form_Load()

branchQuery = "SELECT tblemployee.branch_nm, tblemployee.lname, tblemployee.fname, tblemployee.mname from tblemployee JOIN tblbranch ON tblemployee.Branch_id = tblbranch.branch_id where tblemployee.branch_nm = "

DataEmpList.ListField = "lname"

End Sub


Private Sub DataBranch_Click()

On Error Resume Next
AdoEmployee.RecordSource = branchQuery & "'" & DataBranch.Text & "'"


End Sub