Hi
I want your help in below code, which include 2 tables in list box query.
I have named frmSearch on this form their is a list box placed with rowsource
and following code in btnSearch on click event is incomplete and i am totally blank how to do it with 2 tables with in query to search by LIKE parameter on any of above table's field content including/similar to my search text box value.
Your kind help is required.
I want your help in below code, which include 2 tables in list box query.
I have named frmSearch on this form their is a list box placed with rowsource
Code:
SELECT tblEmployees.EmpID, tblEmployees.FullName, tblEmployees.Surname, tblEmployees.Gender, tblEmployees.Nationality, tblResidentID.Resident_ID FROM tblEmployees INNER JOIN tblResidentID ON tblEmployees.EmpID = tblResidentID.ID;
and following code in btnSearch on click event is incomplete and i am totally blank how to do it with 2 tables with in query to search by LIKE parameter on any of above table's field content including/similar to my search text box value.
Code:
Private Sub btnSearch_Click()
Dim SQL As String
SQL = "SELECT tblEmployees.EmpID, tblEmployees.FullName, tblEmployees.Surname, tblEmployees.Gender, tblEmployees.Nationality, tblResidentID.Resident_ID FROM tblEmployees INNER JOIN tblResidentID ON tblEmployees.EmpID = tblResidentID.ID;"
& " from tblemployees" _
& where [EmpID]"like '*" & me.txtSearch &"*' " _
& or [Fullname]"Like '*" & me.txtSearch &"*' " _
& or [Surname]"Like '*" & me.txtSearch &"*' " _
& or [Gender]"Like '*" & me.txtSearch &"*'" _
& or [Nationality] " Like '*" & me.txtSearch &"*'" _
End Sub
Your kind help is required.