Rx_
Nothing In Moderation
- Local time
- Today, 03:14
- Joined
- Oct 22, 2009
- Messages
- 2,803
This may apply to Terminal server as well:
this might save someone else some embarrasement from my lesson learned.
Environ("username") ' NOT CurrentUser() current user always displayed "admin" in Citrix environment
Set up a usage log, then had a contest with a prize for users to "test the beta program" Got my wish, but every user was "admin" in the Citrix environment. Thousands of clicks.
For Citrix, best to use a split database.
With MZ tools, use a hot key to insert a call to LogUsage function.
this might save someone else some embarrasement from my lesson learned.
Environ("username") ' NOT CurrentUser() current user always displayed "admin" in Citrix environment
Set up a usage log, then had a contest with a prize for users to "test the beta program" Got my wish, but every user was "admin" in the Citrix environment. Thousands of clicks.
For Citrix, best to use a split database.
With MZ tools, use a hot key to insert a call to LogUsage function.
Code:
Option Compare Database
Option Explicit
'-----------------------------------------------------------------
' Procedure : LogUsage
' Author : Rx
' Date : 3/23/2010
' Purpose : Logs user activity to table
'-------------------------------------------------------------------
'
Function LogUsage(ByVal strFormName As String, _
strCallingProc As String, Optional ControlName) As Boolean
10 On Error GoTo Err_LogUsage
Dim rst As DAO.Recordset ' The tLogUsage table
20 Set rst = CurrentDb.OpenRecordset("tLogUsage", , dbAppendOnly)
30 rst.AddNew
40 rst![UseDate] = Now()
50 rst![strFormName] = strCallingProc
60 rst![CallingProc] = strCallingProc
70 rst![UserName] = Environ("username") ' CurrentUser() current user does not show up in Citrix
80 If Not IsMissing(ControlName) Then
90 rst![ControlName] = Left(ControlName, 75)
100 End If
110 rst.Update
120 rst.Close
130 LogUsage = True
Exit_LogUsage:
140 Set rst = Nothing
150 Exit Function
Err_LogUsage:
' just resume next and the usage is not logged
160 Err.Clear
170 Resume Exit_LogUsage
End Function