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) ap_GetUserName = strUserName 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! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/