Hi Jezmo,
The problem is the size of the string; check the modified code.
Hope that helps!
Manuel
jezmo_codpiece <[EMAIL PROTECTED]> wrote:
jezmo_codpiece <[EMAIL PROTECTED]> wrote:
I am trying to get the logged in windows user name to record the
last person to edit a record. I can do this OK using the following:
Function ap_GetUserName() As Variant
Dim strUserName As String
Dim lnglength As Long
Dim lngResult As Long
' set up the buffer
strUserName = String$(255, 0)
lnglength = 255
lngResult = wu_GetUserName(strUserName, lnglength)
If lngResult <> 0 Then
ap_GetUserName = Left$(strUserName, lngResult - 1)else
ap_GetUserName = ""end if
End Function
But the string seems to be filled with non-usable characters after
the username, as when I try to paste this to a text box it tells me
the string is too long. Does anyone know how to easily get just the
user name without the garbage?
Many thanks in advance.
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping
Please zip all files prior to uploading to Files section.
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
- [AccessDevelopers] getting the windows user name jezmo_codpiece
- Re: [AccessDevelopers] getting the windows user name Manuel Tejada
- [AccessDevelopers] Re: getting the windows user name Richard
- RE: [AccessDevelopers] getting the windows user name Lava Boggavarapu
- RE: [AccessDevelopers] getting the windows user name Cathy Jupp
- RE: [AccessDevelopers] getting the windows user name Lava Boggavarapu
- RE: [AccessDevelopers] getting the windows user name Cathy Jupp
- RE: [AccessDevelopers] getting the windows user name Lava Boggavarapu
- RE: [AccessDevelopers] getting the windows user name Cathy Jupp
- [AccessDevelopers] Re: getting the windows user ... Duane Hennessy
Reply via email to