0
votes
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
It should be Private Sub BeforeUpdate(Cancel as Integer) i think... also there is an extra _ before & No_Map.Value and I am not sure you can use an or operator with dbFailOnError Or dbSeeChanges... - user2140173
.. and No_Map is declared as Integer. So No_Map.Value will fail.. .. and No_Map is not initialized with any value .. .. and depending to database backend you have to quote a date value - Klaus

1 Answers

0
votes

The date won't be automatically converted into a date which SQL can handle.

Try strSQL1 = "UPDATE MaponDemand SET SysDate = #" & SysDate & "# WHERE No_Map = " & _ No_Map.Value (hashtags # around the date).