Welcome to the forum......
1. Create a select query with SupervisorHierarchy. Add fields "WWID" and "Owner". Add field "DepartmentDescription" with the expression IIf([SL1WWID]=[WorkCenters]![ManagerWWID], [WorkCenters]![WorkCenter], IIf([SL1WWID]=[WorkCenters]![ManagerWWID], [WorkCenters]![WorkCenter], "Other")). When I ran the query I got a prompt for [WorkCenter]![ManagerWWID] because Access thinks it is a parameter instead of a field in a table.
Cannot refer to a field in a table like that ([WorkCenters]![ManagerWWID])
---------------------------------
2. Create a select query with SupervisorHierarchy. Add fields "WWID" and "Owner". Add field "DepartmentDescription" with the expression DLookup("[WorkCenter], "WorkCenters"). This populates every record result with the first result in the WorkCenter table. I modified the expression to be DLookup("[WorkCenter], "WorkCenters", "[ManagerWWID] = [SL1WWID]") I got an error that Access cannot find SL1WWID. I modified the expression again to be DLookup("[WorkCenter], "WorkCenters", "[ManagerWWID] = [SupervisorHierarchy]![SL1WWID]") and I again got an error that Access cannot find SL1WWID.
Two things here:
1) You have
Code:
DLookup("[WorkCenter], "WorkCenters", "[ManagerWWID] = [SL1WWID]")
There is a missing double quote after [WorkCenter] (before the first comma)
Should be
Code:
DLookup("[WorkCenter]", "WorkCenters", "[ManagerWWID] = [SL1WWID]")
2) You have the criteria "[ManagerWWID] = [SL1WWID]". What you are saying is "Give me the workcenter field value from the WorkCenters domain (table) where the field [ManagerWWID] value is equal to [SL1WWID]".
You need to concatenate the VALUE from the column (in the query) [SL1WWID], not the column name itself.
So the DLookup would look like this
Code:
DLookup("[WorkCenter]", "WorkCenters", "[ManagerWWID] = " & [SL1WWID])
I cannot tell what data types the fields are, so if "[ManagerWWID] is a text type field, you will need to add delimiters.
---------------------------------
3. Create a select query with SupervisorHierarchy and WorkCenters, unlinked. Add fields "WWID" and "Owner". Add field "DepartmentDescription with the expression IIf([SL1WWID]=[ManagerWWID], [WorkCenter], IIf([SL1WWID]=[ManagerWWID],[WorkCenter], "Other")). When I ran the query I got multiple instances of "WWID" and "Owner". One of the instances has the correct "DepartmentDescription" and the remainder were populated with "Other". My record count increased from ~5700 to ~18000.
The reason the record count increased is that you created a Cartesian join. Every record in SupervisorHierarchy is matched with every record in WorkCenters.
---------------------------------
4. Create a select query with SupervisorHierarchy and WorkCenters, linked on [SupervisorHierarchy]![SL1WWID] and [WorkCenters]![ManagerWWID]. Add fields "WWID" and "Owner". Add field "DepartmentDescription with the expression IIf([SL1WWID]=[ManagerWWID], [WorkCenter], IIf([SL1WWID]=[ManagerWWID],[WorkCenter], "Other")). When I ran the query I got only the "WWID" and "Owner" results that have a manager matching at SL1. I would rather not repeat this query 7 times (once for each SL #) then create a UNION ALL query.
A version of this was originally created in Excel using
This is an indication of a non-normalized table structure. I appears that someone tried to convert something that works in Excel into an Access database without doing a proper design. This is known as "Committing Spreadsheet". (Yes, it is so common a problem that it has a name)
Sorry I can't provide a better answer, but you haven't provided the field types, table structures or table relationships.