Can anyone help with this error
This is my code and it keeps falling over at the and keep getting error that
the join cannot occur:
strSQlCS = "UPDATE tblinventory " & vbCrLf
strSQlCS = strSQlCS & " INNER JOIN tblinventorydetail " & vbCrLf
strSQlCS = strSQlCS & " ON tblinventorydetail.productID =
tblinventorydetail.productID SET tblinventorydetail.Sumofqty =
[tblinventorydetail]![SumOfqty]+[tblinventorydetail]![qty]" & vbCrLf
strSQlCS = strSQlCS & " , tblinventorydetail.Sumofweight =
[tblinventorydetail]![SumOfweight]+[tblinventorydetail]![weight]" & vbCrLf
strSQlCS = strSQlCS & " WHERE
(((tblinventorydetail.productID)=[tbinventory]![ProductID]) " & vbCrLf
strSQlCS = strSQlCS & " AND
((tblinventorydetail.name)=[tblinventorydetail]![name]));"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQlGIL
DoEvents
Any idea why this fails
TIA
Les
MH - 21 May 2006 18:54 GMT
Your statement reads:
UPDATE tblinventory INNER JOIN tblinventorydetail ON
tblinventorydetail.productID = tblinventorydetail.productID
Surely that should be:
UPDATE tblinventory INNER JOIN tblinventorydetail ON tblinventory.productID
= tblinventorydetail.productID
What you were trying to do was to join a table to itself.
MH
> Can anyone help with this error
>
[quoted text clipped - 22 lines]
> TIA
> Les
LJG - 21 May 2006 23:16 GMT
Cheers Thanks for that....that busy looking for the problem I could not see
it.
Les
> Your statement reads:
>
[quoted text clipped - 36 lines]
>> TIA
>> Les
MH - 24 May 2006 21:15 GMT
We've all been there! <g>
MH
> Cheers Thanks for that....that busy looking for the problem I could not
> see it.
[quoted text clipped - 42 lines]
>>> TIA
>>> Les