L
Lez
Hi Guys,
Can anyone see a problem with this update code:
strSQlCS = "UPDATE tblinventory " & vbCrLf
strSQlCS = strSQlCS & " INNER JOIN tblinventorydetail " & vbCrLf
strSQlCS = strSQlCS & " ON tblinventory.productID =
tblinventorydetail.productID SET tblinventory.Sumofqty =
[tblinventory]![SumOfqty]+[tblinventorydetail]![qty]" & vbCrLf
strSQlCS = strSQlCS & " , tblinventory.Sumofweight =
[tblinventory]![SumOfweight]+[tblinventorydetail]![weight]" & vbCrLf
strSQlCS = strSQlCS & " WHERE
((tblinventorydetail.productID)=[tblinventory]![ProductID]) " & vbCrLf
strSQlCS = strSQlCS & " AND
((tblinventorydetail.batchid)=[tblinventory]![batchid]);" & vbCrLf
strSQlCS = strSQlCS & " AND
((tblinventorydetail.name)=[tblinventory]![name]);"
When I run this for the first time it adds just the first record and nothing
else, if I then try and run it a second time I keep getting a Run-time
error'3142':
Characters found at end of SQL statement.
Any suggestions or help would be appreciated.
TIA
Lez
Can anyone see a problem with this update code:
strSQlCS = "UPDATE tblinventory " & vbCrLf
strSQlCS = strSQlCS & " INNER JOIN tblinventorydetail " & vbCrLf
strSQlCS = strSQlCS & " ON tblinventory.productID =
tblinventorydetail.productID SET tblinventory.Sumofqty =
[tblinventory]![SumOfqty]+[tblinventorydetail]![qty]" & vbCrLf
strSQlCS = strSQlCS & " , tblinventory.Sumofweight =
[tblinventory]![SumOfweight]+[tblinventorydetail]![weight]" & vbCrLf
strSQlCS = strSQlCS & " WHERE
((tblinventorydetail.productID)=[tblinventory]![ProductID]) " & vbCrLf
strSQlCS = strSQlCS & " AND
((tblinventorydetail.batchid)=[tblinventory]![batchid]);" & vbCrLf
strSQlCS = strSQlCS & " AND
((tblinventorydetail.name)=[tblinventory]![name]);"
When I run this for the first time it adds just the first record and nothing
else, if I then try and run it a second time I keep getting a Run-time
error'3142':
Characters found at end of SQL statement.
Any suggestions or help would be appreciated.
TIA
Lez