I'm try to get the result of a Dlookup below so I can use the result later.
In debugging the code. I have made sure that the P3rdBUSID and MatterID have both got the correct Values expected.
Its just that strContIDLookup does not get the result assigned to it?
Am I doing something completely wrong?
I've tried to use SQL to run the query but my knowledge of SQL in a VBA subroutine is zero, when I run the query as a Access Query and I get the correct result (although I've manually added the relevent numbers in)
Is there a way of doing this with the SQL instead of Dlookup? getting lost at the moment!
Thanks
In debugging the code. I have made sure that the P3rdBUSID and MatterID have both got the correct Values expected.
Its just that strContIDLookup does not get the result assigned to it?
Am I doing something completely wrong?
Code:
StrContIDLookup = DLookup("MA_3rd_P_C_ID", "qry_matters_list_add_3rd_P_Bus_Generic", "MA_3rd_P_B_ID = '" & P3rdBUSID & "' and MA_M_ID = '" & MatterID & "'")
I've tried to use SQL to run the query but my knowledge of SQL in a VBA subroutine is zero, when I run the query as a Access Query and I get the correct result (although I've manually added the relevent numbers in)
Code:
SELECT MA_3rd_P_C_ID From qry_matters_list_add_3rd_P_Bus_Generic Where (((MA_3rd_P_B_ID)=38)) and (((MA_M_ID)=11)
Is there a way of doing this with the SQL instead of Dlookup? getting lost at the moment!
Thanks