Runtime Error 3144: Help!

Pooks_35

Registered User.
Local time
Today, 14:58
Joined
Mar 14, 2013
Messages
54
So I have searched through the forums and tried numerous things to fix this code, but the line I have bolded below continues to be highlighted yellow and I keep getting the Runtime Error 3144. Any suggestions on what is wrong with the code would be greatly appreciated! Thanks in advance!

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE tbl_ESW_ThirdPartyPaymentsAssigned SET TPPaymentID = " & Forms![Third Party Accounts]!frmThirdPartyPayments.Form![TPPaymentID] & " WHERE SelectedCamper = -1 AND TPPaymentID Is Null"
DoCmd.RunSQL "UPDATE tbl_ESW_ThirdPartyPaymentsAssigned SET TPPaymentID = NULL WHERE SelectedCamper = 0"
DoCmd.SetWarnings True
 
Put a break point on the docmd.RunSQL line.
At runtime, in the immediate Window add:
? "UPDATE tbl_ESW_ThirdPartyPaymentsAssigned SET TPPaymentID = " & Forms![Third Party Accounts]!frmThirdPartyPayments.Form![TPPaymentID] & " WHERE SelectedCamper = -1 AND TPPaymentID Is Null" <then enter>

With the resulting string, copy that from the Immediate Window
Create a New Query, choose the SQL view
Paste in the string from the Immediate Window.
Switch back to Design view in the query window.

Does it represent what you expected?
If you run the query - does it update properly?
 
Hi Rx_,
When I paste the results into sql and hit design view, I still get the Syntax error in UPDATE statement error. So I still haven't figured out what is wrong with the statement for it not to work.:banghead:
 
Please post the string from the debug window, maybe someone can spot something.
 

Users who are viewing this thread

Back
Top Bottom