techsupport3977
Technical User
Most of my forms use the below RUNSQL command to log what data they are viewing in order for me to serve them better. My concern is the "environ('username')". About 1% of the log table show the user name as blank whne the user has a domain account and is currently logged in the domain. What are the possibilities that can be causing this and how do I fix this? The inability of MsAccess to determine who is logged into the Db also causes a 1% "LOGON FAILURE" to forms because of security rights.
DoCmd.SetWarnings False
DoCmd.RunSQL " INSERT INTO LOG_REPORT ( [DATE], [USER], HOST ,TASK, DB )" & _
"SELECT now() AS [DATE], environ('username') AS [USER], environ('computername') AS HOST ,'" & Me.Name & "','" & CurrentDb.Name & "'"
DoCmd.SetWarnings True
DoCmd.SetWarnings False
DoCmd.RunSQL " INSERT INTO LOG_REPORT ( [DATE], [USER], HOST ,TASK, DB )" & _
"SELECT now() AS [DATE], environ('username') AS [USER], environ('computername') AS HOST ,'" & Me.Name & "','" & CurrentDb.Name & "'"
DoCmd.SetWarnings True