Docmd.RunSQL

IanT

Registered User.
Local time
Today, 00:14
Joined
Nov 30, 2001
Messages
191
Hi

Trying to use this code but it errors on the "Settled", I assume the syntex is incorrect. Can anyone advise

Thanks

DoCmd.RunSQL "UPDATE tblCostProcessedData SET tblCostProcessedData.[Settled?] = "Settled" " & _
"WHERE (((tblCostProcessedData.[Date Costs Agreed]) Is Not Null));"
 
put single quotes around settled instead of double, e.g. 'settled'
 
Simple Software Solutions

Your code

DoCmd.RunSQL "UPDATE tblCostProcessedData SET tblCostProcessedData.[Settled?] = "Settled" " & _
"WHERE (((tblCostProcessedData.[Date Costs Agreed]) Is Not Null));"

Can be simplified as below

DoCmd.RunSQL "UPDATE tblCostProcessedData SET [Settled?] = 'Settled' WHERE [Date Costs Agreed] Is Not Null;"

Tow tips

1. Don't use ? marks as part of a field name
2. Don't have spaces between words in field names

CodeMaster::cool:
 

Users who are viewing this thread

Back
Top Bottom