Syntax Error (Missing Operator) UPDATE Query

B

Billp

I have a form with a subform - parent child.
The form is called frmPackingSlip the subform sfrmPacking_Others

sfrmPacking_Others data source is tblOtherPacking_Slip


Say the main form is Packing slip number 1with a Revision 0 ie.
Me!Packing_Slip =0, and Me!PS_ID =1
Packing_Slip = The Revison Number = numeric
PS_ID is the Packing Slip Number which is an Autonumber = numeric.

The UPDATE query is supposed too append the Revison number to the subform
However I get " Syntax Error (Missing Operator) in Query Expression '1 WHERE
Link_ID=1'

strAppendPSNumber = "UPDATE [tblOther_Packing_Slip] " _
& "SET Packing_Slip = " & Me!Packing_Slip _
& "WHERE Link_ID = " & Me!PS_ID
Debug.Print strAppendPSNumber

Link_ID is the reference back to the PackingSlip Number.

ummmmmmmmmmmmmmmmmmmmmmmmmm
Syntax Error (Missing Operator) - ummmmmmmmmmmmmm

I thank you in advance
Best regards
 
D

David H

Off the bat, there's some syntax issues with the SQL statement. There needs
to be a space in front of the WHERE keyword. Also, I think that the problem
is also tied to the underscore in the second line. As a rule, I've never used
them so I can't speak to that.

If that doesn't solve the problem add a DEBUG.PRINT strAppendPSNumber and
take a look at the string that you're building. If you can't spot a problem
with it, please post the result back here.

Also, you might need single apostrophes around Me!Packing_Slip, but I can't
tell since I don't know the field type.

strAppendPSNumber = "UPDATE [tblOther_Packing_Slip] " _
& "SET Packing_Slip = " & Me!Packing_Slip " _
& " WHERE Link_ID = " & Me!PS_ID
 
B

Billp

Cheers David,

It was the space.

Onward
Best regards

David H said:
Off the bat, there's some syntax issues with the SQL statement. There needs
to be a space in front of the WHERE keyword. Also, I think that the problem
is also tied to the underscore in the second line. As a rule, I've never used
them so I can't speak to that.

If that doesn't solve the problem add a DEBUG.PRINT strAppendPSNumber and
take a look at the string that you're building. If you can't spot a problem
with it, please post the result back here.

Also, you might need single apostrophes around Me!Packing_Slip, but I can't
tell since I don't know the field type.

strAppendPSNumber = "UPDATE [tblOther_Packing_Slip] " _
& "SET Packing_Slip = " & Me!Packing_Slip " _
& " WHERE Link_ID = " & Me!PS_ID

Billp said:
I have a form with a subform - parent child.
The form is called frmPackingSlip the subform sfrmPacking_Others

sfrmPacking_Others data source is tblOtherPacking_Slip


Say the main form is Packing slip number 1with a Revision 0 ie.
Me!Packing_Slip =0, and Me!PS_ID =1
Packing_Slip = The Revison Number = numeric
PS_ID is the Packing Slip Number which is an Autonumber = numeric.

The UPDATE query is supposed too append the Revison number to the subform
However I get " Syntax Error (Missing Operator) in Query Expression '1 WHERE
Link_ID=1'

strAppendPSNumber = "UPDATE [tblOther_Packing_Slip] " _
& "SET Packing_Slip = " & Me!Packing_Slip _
& "WHERE Link_ID = " & Me!PS_ID
Debug.Print strAppendPSNumber

Link_ID is the reference back to the PackingSlip Number.

ummmmmmmmmmmmmmmmmmmmmmmmmm
Syntax Error (Missing Operator) - ummmmmmmmmmmmmm

I thank you in advance
Best regards
 

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

Top