Basically I am trying to make a query that will count the number of employees on a given project (Access 2003 / Win XP). The given project is the Project text box on a report (fed by another query).
So the issue I am having is that each employee has upto 4 projects, so I need to say if any of their 4 projects = the project on the report, then keep them.
I first tried it with a brutal IIF statement, said too complex. Then wrote it in VBA, says too complex.
Code is:
Function ProjectCompare(p1 As String, p2 As String, p3 As String, p4 As String, pr As String) As Boolean
If ((p1 = pr) Or (p2 = pr) Or (p3 = pr) Or (p4 = pr)) Then
ProjectCompare = True
Else
ProjectCompare = False
End If
End Function
Any suggestions on making this work?