No one has talked about the meaning of the error.
Error #3144 = Syntax error in UPDATE
Evaluation of this version of the code (when Total1 = 25, Cost1 = $35.00 and ID = 2345) shows the following:
sql = "UPDATE [master contract] SET total1 = 25, cost1 = 35.00
, WHERE ID = 2345"
It looks like there may be an extra comma here. I know that this is a sample version, but removing the comma might make it work. If it does, there there might be a similar error in the complete formula.
Another thing for you to consider is that you may be exceeding the character limit for an SQL Query.