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!

editing a variable from a specific character 1

Status
Not open for further replies.

alfordjj

MIS
Jul 23, 2003
80
US
Ok, I know this is an question that you've probably seen 1K times, but I can't find an answer for it in my searches. I thought I'd seen it on here before, but I guess I'm searching wrong.

I'm grabbing the LoginName of the user and sticking it into a variable, but need to pull off the "domain" section that precludes it. Here's the problem, There will be a couple different domains, so I don't know exactly how long of a string to pull off or the exact string to pull off.

The good news is, as you know, the format will always be "domain\username." So if I can figure out how to count over to the "\" then delete everything to the left of that, I'm good.

Any ideas about how to do this?? Thanks tons!!
 
Mid(LoginName, 1 + InStr(LoginName, "\"))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top