I have 2 list boxes the first named listFunctions and the Second is listEmp
using the below code i had the result of when i clicked on the function the same function would be displayed:
Private Sub ListFunction_AfterUpdate()
With Me!
[listEmp]
If IsNull(Me!listFunction) Then
.RowSource = ""
Else
.RowSource = "SELECT [tblFunctions].[FctnID], [tblFunctions].[FctnDesc]" & _
"FROM tblFunctions " & _
"WHERE [tblFunctions].[FctnID]=" & Me!listFunction
End If
Call .Requery
End With
End Sub
the info I really want from the listEmp is in the query below. How could I translate this query into the above code
if at all?
SELECT tblFunctions.FctnDesc, tblEmpRec.EmpID, tblEmpRec.Name, tblEmpRec.First
FROM tblFunctions INNER JOIN ((tbl_shift INNER JOIN tblEmpRec ON tbl_shift.ShiftCode = tblEmpRec.Shift) INNER JOIN ratings ON tblEmpRec.EmpID = ratings.EmpId) ON tblFunctions.FctnID = ratings.FctnID
WHERE (((ratings.FctnID) Like [Forms]![Form1]!
[ListFunction]))
ORDER BY tblEmpRec.Name;