S
slickdock
I would like the currently logged in windows user name to autopopulate the
[LastRevisedBy] field in a record. I am aware of, and have the code that
returns the network login name (see below). My question is, how do I have
the [LastRevisedBy] field in my form fill in with that info when the record
is revised? I am a newbie at VBA, so please go easy on me. Thank you.
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
[LastRevisedBy] field in a record. I am aware of, and have the code that
returns the network login name (see below). My question is, how do I have
the [LastRevisedBy] field in my form fill in with that info when the record
is revised? I am a newbie at VBA, so please go easy on me. Thank you.
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