Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error (Missing Operator) after converting Update Query to SQL 1

Status
Not open for further replies.

Boham

Technical User
Jun 8, 2006
23
US
In an attempt to speed things up, I converted a working Update Query to SQL. Now when the expression is run, I am receiving a Syntax Error (Missing Operator) in query expression. Through my own investigation, the SQL Statement appears to be correct, Can someone with more knowledge than I point me to the error I made?

Dim SQL As String

SQL = "UPDATE Pub_Index " & _
"Set Unit_Cost = Forms!PurchaseOrders![Purchase Order Details Subform].Form!ItemCost / Forms!PurchaseOrders![Purchase Order Details Subform].Form!Quantity" & _
"Where Pub_Index.Pub_No = PurchaseOrderDetails.Pub_No"

DoCmd.RunSQL SQL
 
1) Put a space before the Where keyword.
2) As the PurchaseOrderDetails table is not declared, I presume you wanted this:
" WHERE Pub_Index.Pub_No = Forms!PurchaseOrders![Purchase Order Details Subform].Form!Pub_No"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That worked Perfectly! Thank you sooo much PH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top