Hello,
I have code that can retrieve the username of the current person logged onto windows in Access 2010 32bit.
Code:
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 = ""
End If
End Function
We are starting to move over to Access 2013 64bit and when we open the database up it goes into debug mode.
Does anyone know what changes to this code need to take place in order for me to still retrieve their windows sign on name?
Also, not all the laptops that use the database will be swapped over at once, so some will have the old 2010 32bit and some will have 2013 64bit, can code be created to find what system they're using before the code retrieve's their sign on details?
Thank you in advance for your help!!!!!!!