Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    35

    Unanswered: Current Username

    How I obtain a Current username and then put this in a text box in my frm Main.

  2. #2
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    Set the control source for the text box =CurrentUser()

    walla

    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    To get the logged Name:


    Private Declare Function apiGetUserName Lib "ADVAPI32.DLL" Alias _
    "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long



    Function LoggedName() 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
         LoggedName = Left$(strUserName, lngLen - 1)
       Else
         LoggedName = vbNullString
       End If
    End Function

  4. #4
    Join Date
    Mar 2004
    Location
    Berlin, Germany
    Posts
    107
    thanks hamm

    was just looking for a ready to use snippet of that function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •