I have created an Excel file that allows a user to use it to enter and capture data. When the user has completed entries, the VBA code then sends the PDF image of the worksheet to a SharePoint library (no problem here, it works great!). It also posts the data entries from the Excel sheet into a SharePoint list (using 'INSERT INTO' no problem here either, it works great!). Finally, the VBA is supposed to update the SharePoint library item (just posted) with relevant/desired entries. The run-time error '-2147217900 (80040e14)': code is 'Syntax error in UPDATE statement'. Here (below) is the relevant code (redacted). What am I missing?
Set cnt = New ADODB.Connection
With cnt
.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=0;RetrieveIds=Yes;DATABASE=site link goes here;LIST={LIST ID Redacted for posting};"
.Open
End With
mySQL = "UPDATE [{LIST ID Redacted for posting}] SET [Lot_Date] = '" & LotDate & "' WHERE [Name] = '" & pdfName & "'"
MsgStr = mySQL
MsgBox MsgStr, vbOKOnly
cnt.Execute (mySQL)
If CBool(cnt.State And adStateOpen) = True Then cnt.Close
Set cnt = Nothing
Bookmarks