我在更新语句中遇到语法错误。运行时错误:3144我使用以下代码

时间:2017-06-07 00:19:02

标签: access-vba

Dim strMyTable As String 
Dim strMyField As String 
Dim strMyCombo As Boolean 
Dim strSQL As String  
strMyTable = "ItemDetails"  '(or whatever the true names are...) 
strMyField = "Chk" 
strMyCombo = False  
strSQL = "UPDATE " & strMyTable _ & "SET " & strMyField & "=" & strMyCombo & ";"          
Application.CurrentDb.Execute strSQL  
End Sub

1 个答案:

答案 0 :(得分:0)

试试这个:

Dim strMyTable As String 
Dim strMyField As String 
Dim strMyCombo As String
Dim strSQL As String  

strMyTable = "ItemDetails"  '(or whatever the true names are...) 
strMyField = "Chk" 
strMyCombo = "False"  
strSQL = "UPDATE " & strMyTable & " SET " & strMyField & "=" & strMyCombo & ";"          
Application.CurrentDb.Execute strSQL