DLookup syntax

Ben_Entrew

Registered User.
Local time
Today, 08:13
Joined
Dec 3, 2013
Messages
177
Hi all,

can somebody please help me?

Something is wrong with this dlookup in :

Code:
strSQL = "Update TNS Set TNS_in_TRY = " & _
           " Nz([TNS_in_TRY],0) + " & Str(a) & " * Dlookup([TNS_in_TRY],TNS,Division = 'COMMON' AND Product_Class = 'Scrap_Sales' AND Reporting_Month = '" & t & "') " &
           " Where Division IN ('AK') AND Product_Class = 'Scrap Sales' AND Reporting_Month = '" & t & "'"


I debugged a and t these variables are correct.
Thanks in advance.

Regards,

Ben
 
Have you tried pasting the rSQL string in the sql for a query and look at the design window?
 
I am guessing the missing _ on the end of the second line?
 
Ben_Entrew, Divide and Conquer. Take the DLookup out of the UPDATE statement, give it to a variable.
 

Users who are viewing this thread

Back
Top Bottom