******************** Code Start **************************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
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
'******************** Code End **************************Private Sub Form_AfterInsert()
Me.mein_user = fOSUserName
End Sub
Access: Datum und User-Name automatisch
Maggi 06.03.2007 - 164 Hits - 1 Antwort
Inhalt Kombi-Feld in andere Tabelle schreiben
mbalrog 16.08.2007 - 20 Hits - 1 Antwort
Access-Tabelle: Wie füge ich Felder an eine aus Excel übernommene Tabelle an?
RATLOS1000 05.11.2007 - 196 Hits - 7 Antworten
Wie kann man mittels VBA Termine in Outlook schreiben
maxim66 15.11.2007 - 112 Hits - 1 Antwort
Access 2007 2 Tabellen vergleichen, Inhalt Tabelle 2 in Tabelle 1 schreiben
wolpi27 20.05.2008 - 85 Hits - 17 Antworten