-----Original Message-----
I am running Access 2000 on a small Windows 98 (and Windows 2000) network.
I want to know the name of the user. How is that done? Do I have to get it
from the registry? How?
Try this
Option Compare Database
Private Declare Function apiGetUserName Lib "advapi32.dll"
Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As
Long) As Long
Public Function fOSUserName() As String
' Returns the network login name
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
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
then call the function like this example using a MsgBox:
MsgBox "Hello " & fOSUserName
I have a table that stores the time each and every time a
user logs into the application using this function.