Looking for that extra special effect to give your database project a professional flair. Would you like to display your User's names as they log in to the database?
If the answer is yes then carry on reading.........
Step 1. Create a Welcome form: Please see the article entitled Add a Welcome Message to Your Database for details on how to do this.
Step 2. Create the Module shown below: To enable you to automatically pick up the user name from the network login details. This will also automatically pick up stand alone login details (tested on Windows XP).
Private Declare Function apiGetUserName _
Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
'-------------------------------------------------
' This code is used to retrieve the network user
' name by accessing the API apiGetUserName.
' Created by: Unknown (Found on Dev Ashish
' web site www.mvps.org/access/)
' This code has not been altered in anyway.
' Added to database: 27 dec 1999
' Added by: Richard Rensel
'-------------------------------------------------
Function fOSUserName() As String
On Error GoTo