Hi,
you can go 2 ways about this:
* create a class module UserInfo (or something like that) and write all properties end methods you need concerning users and security in this class. In the rest off your code you can use this class as a normal object.
* use the windows user name; one way of getting this is the following function (mind you for windows 64 you'll probably need to add theptrsafe instruction)
Code:
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function getOSUserName() As String
On Error GoTo Err_getOSUserName
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If (lngX > 0) Then
getOSUserName = Left$(strUserName, lngLen - 1)
Else
getOSUserName = vbNullString
End If
Exit_Err_getOSUserName:
Exit Function
Err_getOSUserName:
Call gsgErrorHandling
Resume Exit_Err_getOSUserName
End Function
greeting
NG