运行时错误3075 - 缺少操作员 - VBA访问

时间:2014-04-15 13:45:35

标签: vba access-vba

Option Explicit

Private Sub BeforeUpdate

    Dim No_Map As Integer
    Dim SysDate As Date

    SysDate = Now()

    Debug.Print "Date is " & SysDate
    strSQL1 = "UPDATE MaponDemand SET SysDate = " & SysDate & " WHERE No_Map = " & _ No_Map.Value
    db.Execute strSQL1, dbFailOnError Or dbSeeChanges
End Sub

1 个答案:

答案 0 :(得分:0)

日期不会自动转换为SQL可以处理的日期。

尝试 strSQL1 = "UPDATE MaponDemand SET SysDate = #" & SysDate & "# WHERE No_Map = " & _ No_Map.Value(日期周围的标签)。