I'm trying to update a table in Access VBA and it keeps failing, so I really hope one of you can help. Basicly I want to update table tblLog, the field LogOut with the variable logOutTime, where LogID is equal to LogID from the current form.
The first one gave error "3075"
Dim mySQL As String Dim logOutTime As String logOutTime = Now() mySQL = "UPDATE [tblLog] SET [LogUd]=" & logOutTime & " WHERE [Logid] =" & Me.LogID & "" DoCmd.RunSQL mySQL
and the second gave me error "3464"
DoCmd.RunSQL ("UPDATE tblLog " _
& "SET LogUD='" & logOutTime & "' " _
& "WHERE (((LogID)='" & Me.LogID & "'))")
Hope you can help, just don't understand when to put the ' or the ".
/Camilla