First just let me say thanks for providing insight on this, it is much appreciated. Now to get down to it, my query is quite complex which is why I didn't want to get into too much detail...essentially, what I am trying to do is run a complicated query that uses DLOOKUP to find a multitude of values from a table, however, I want to make the table that the query runs off of a variable that comes from a combobox populated by the user. I have a working query but it has the table name "hard coded" in the query...see the table name at the very bottom?? the table name is ZZ_PROJECT_X but I will have several projects and I want to be able to run this query for any of them thus the form combobox which states the project: In a nutshell, I want to run the query below except that instead of running it on table ZZ_PROJECT_X, it runs for a table specified by the user in a form.
SELECT [C1_PROJ] & [C2_PROJ] & [PS1A_PROJ] & [PS2A_PROJ] & [PS1B_PROJ] & [PS2B_PROJ] & [EP1_PROJ] & [EP2_PROJ] & [M1_PROJ] & [M2_PROJ] & [M3_PROJ] & [G1_PROJ] & [G2_PROJ] & [SA1_PROJ] & [SA2_PROJ] AS commodity_code, DLookUp("[COMP_DESC]","01_COMP_TYPE","[C1] = '" & [C1_PROJ] & "' and [C2] = '" & [C2_PROJ] & "'") & ", " & DLookUp("[MATL]","04_MATL_CODE","[M1] = '" & [M1_PROJ] & "' and [M2] = '" & [M2_PROJ] & "' and [M3] = '" & [M3_PROJ] & "'") & ", " & IIf([C1_PROJ]="P" And [C2_PROJ]="P",DLookUp("[PS_DESC]","02_PRESS_SCH","[PS1] = '" & [PS1A_PROJ] & "' and [PS2] = '" & [PS2A_PROJ] & "'") & " " & DLookUp("[END_PREP]","03_END_PREP","[EP] = '" & [EP1_PROJ] & "'"),DLookUp("[PS_DESC]","02_PRESS_SCH","[PS1] = '" & [PS1A_PROJ] & "' and [PS2] = '" & [PS2A_PROJ] & "'") & " " & DLookUp("[END_PREP]","03_END_PREP","[EP] = '" & [EP1_PROJ] & "'") & " by " & DLookUp("[PS_DESC]","02_PRESS_SCH","[PS1] = '" & [PS1B_PROJ] & "' and [PS2] = '" & [PS2B_PROJ] & "'") & " " & DLookUp("[END_PREP]","03_END_PREP","[EP] = '" & [EP2_PROJ] & "'")) & ", " & DLookUp("[GEOM_STD]","05_GEOM_STD","[G1] = '" & [G1_PROJ] & "' and [G2] = '" & [G2_PROJ] & "'") & IIf([SA1_PROJ]="Z" And [SA2_PROJ]="Z",".",", " & DLookUp("[SA_DESC]","06_SPECIAL_ATT","[SA1] = '" & [SA1_PROJ] & "' and [SA2] = '" & [SA2_PROJ] & "'")) AS FULL_DESCRIPTION
FROM ZZ_PROJECT_X;