My guess is that it has to do with your Where clause, which looks like:
"WHERE dbo_tblOrgLook_master.Analyst " & Analyst & " AND dbo_tblOrgLook_master.Org " & Org & " AND dbo_tblOrgLook_master.CostCenter " & CostCenter & " AND dbo_tblOrgLook_master.Fund " & Fund & " AND dbo_tblOrgLook_master.PEC " & PEC
Generally, you would need to put an = sign in there somewhere, and for fields that are non-numeric, you would have to offset the value with quotes. So, assuming that Org is a string and the others are all numeric, it might look like:
" WHERE dbo_tblOrgLook_master.Analyst = '" & Analyst & "' " _
& " AND dbo_tblOrgLook_master.Org =" & Org _
& " AND dbo_tblOrgLook_master.CostCenter =" & CostCenter _
& " AND dbo_tblOrgLook_master.Fund =" & Fund _
& " AND dbo_tblOrgLook_master.PEC =" & PEC
Rey Obrero (Capricorn1)
how are the variables Analyst, Org, CostCenter, Fund, PEC defined?
there should be an equal sign before them and should be treated depending on the Data Type
i.e.,
if Analyst is Number
WHERE dbo_tblOrgLook_master.Analyst = " & Analyst & "
if Analyst is Text
WHERE dbo_tblOrgLook_master.Analyst = '" & Analyst & "'
Does it give you an error message or is it not returning the records you expect.
If the former, please post the error message. If the latter, can you describe what you want the query to do.