Ben_Entrew
Registered User.
- Local time
- Yesterday, 23:57
- Joined
- Dec 3, 2013
- Messages
- 177
Hi all,
I got the following problem.
This code doesn't calculate the exact value:
My variable b is 0.230.
The TNS is multiplied with 0.228.
It seems a problem with the Str(b).
Can anyone help me out?
Thanks.
Regards,
Ben
I got the following problem.
This code doesn't calculate the exact value:
Code:
Sub TEST()
Dim strSQL As String
Dim b As Double
DoCmd.SetWarnings False
b = DLookup("MC", "COMMON_DISTRIBUTION", "YEAR = 2015")
strSQL = "Update TNS_HIST Set [TNS_in_TRY] = " & _
" [TNS_in_TRY] + " & Str(b) & " * DSum(""TNS_in_TRY"",""TNS_HIST"",""Division = 'COMMON' AND Product_Class = 'Scrap Sales' And Reporting_Month = '042015'"") " & _
" Where Division IN ('MC') AND Product_Class = 'Scrap Sales' and Reporting_Month = '042015'"
DoCmd.RunSQL strSQL
End Sub
The TNS is multiplied with 0.228.
It seems a problem with the Str(b).
Can anyone help me out?
Thanks.
Regards,
Ben