Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed to get user id value using VBA. 1

Status
Not open for further replies.

101287

MIS
Apr 8, 2006
189
US
I have the code below and don't know how to correct the error. I'm getting "Can find DLL library".
Option Compare Database
' Declare for call to mpr.dll.
Declare Function WNetGetUser Lib "mpr.dll" _
Alias "WNetGetUserA" (ByVal lpName As String, _
ByVal lpUserName As String, lpnLength As Long) As Long
Public newName, eMail, copy As String
Public assignee, lpassigneename, issue, comment As String
Public ctrlname As String
Const NoError = 0 'The Function call was successful

Sub GetUserName()
Const lpnLength As Integer = 255
Dim Status As Integer
Dim lpName, lpUserName As String
lpUserName = Space$(lpnLength + 1)
Status = WNetGetUser(lpNa..........
What I'm trying to do is to get the user id of the person that sign on in the computer and then validate their user id.

Can someone please provide me some guidance to resolve this problem.

Thank you,

Luis
 
Thank you dhookom. Excellent guidance. It works like a champ.

Keep it up my friend.

Luis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top