I'm trying to get a record written to a table showing when a table opens. I want to see Date/Time, UserName, "***Report has been opened." I'm having issue here:
Public Function LogEvt()
Dim SQL As String
SQL = "INSERT INTO AuditTrail ( DateTime, UserName, FormName ) SELECT #" & Now() & "#, fOSUserName(), '" & LogEvent & "';"
DoCmd.RunSQL SQL
End Function
I was getting errors with INSERT INTO. DoCmdRunSQL is highlighted in yellow, so I assume there is still an issue. SuggestionS?
Public Function LogEvt()
Dim SQL As String
SQL = "INSERT INTO AuditTrail ( DateTime, UserName, FormName ) SELECT #" & Now() & "#, fOSUserName(), '" & LogEvent & "';"
DoCmd.RunSQL SQL
End Function
I was getting errors with INSERT INTO. DoCmdRunSQL is highlighted in yellow, so I assume there is still an issue. SuggestionS?