join expression not supported

  • Thread starter Thread starter LJG
  • Start date Start date
L

LJG

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
 
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
 
Cheers Thanks for that....that busy looking for the problem I could not see
it.

Les

MH said:
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


LJG said:
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
 
We've all been there! <g>

MH

LJG said:
Cheers Thanks for that....that busy looking for the problem I could not
see it.

Les

MH said:
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


LJG said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Update Error 5
Help...'Variable Not Defined' 3

Back
Top