I am trying to move my Access application over to SQL Server and have a problem with one table not updating. The code creates a simple log file of user actions in the program.
In Access I have a Module with the following code -
Public Sub Logit(Description As String, Optional Notes As String = "")
Dim UserID As Long
Dim db As Database
Dim rs As Recordset
'on error resume next
UserID = Nz(Forms!MainMenuF!txtUserID)
Set db = CurrentDb()
Set rs = db.OpenRecordset("LogT", dbOpenDynaset)
rs.AddNew
rs!UserID = UserID
rs!Description = Description
If Notes <> "" Then rs!Notes = Notes
rs.Update
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
Using this I can just add Logit in any of my code and it write to the table who accessed something (form, control etc) and puts it in a table called LogT with a time stamp. It works great in Access but moving it over using the Microsoft Access to SQL Migration tool it no longer works and I'm stuck as to why and how to fix it. Below is a picture of the log file.
Any help on figuring this out would be appreciated
Steve
In Access I have a Module with the following code -
Public Sub Logit(Description As String, Optional Notes As String = "")
Dim UserID As Long
Dim db As Database
Dim rs As Recordset
'on error resume next
UserID = Nz(Forms!MainMenuF!txtUserID)
Set db = CurrentDb()
Set rs = db.OpenRecordset("LogT", dbOpenDynaset)
rs.AddNew
rs!UserID = UserID
rs!Description = Description
If Notes <> "" Then rs!Notes = Notes
rs.Update
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
Using this I can just add Logit in any of my code and it write to the table who accessed something (form, control etc) and puts it in a table called LogT with a time stamp. It works great in Access but moving it over using the Microsoft Access to SQL Migration tool it no longer works and I'm stuck as to why and how to fix it. Below is a picture of the log file.
Any help on figuring this out would be appreciated
Steve