Probably the most reliable is to call the Windows API by adding the
following module to the database:
''''module starts''''
Option Compare Database
Option Explicit
Declare Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" (ByVal _
lpBuffer As String, nSize As Long) As Long
Public Function GetUser() As String
Dim strBuffer As String
Dim lngSize As Long, lngRetVal As Long
lngSize = 199
strBuffer = String$(200, 0)
lngRetVal = GetUserName(strBuffer, lngSize)
GetUser = Left$(strBuffer, lngSize - 1)
End Function
''''module ends''''
You can then call the GetUser() function to return the current user.
Ken Sheridan
Stafford, England