[AccessD] Simple String Help

Max Wanadoo max.wanadoo at gmail.com
Sun Jan 17 04:32:05 CST 2010


Two tests are not necessary.

str = Mid(str, InStrRev(str, "\") + 1)

works on "me", "c:\me.txt", "c:\me\me\me\me", etc


max


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Murphy
Sent: 17 January 2010 01:15
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Simple String Help

Use instrRev twice searching on "\" should do it. On the first one trim off
the file name. On the second get the foldername. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Robert
Sent: Saturday, January 16, 2010 4:06 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Simple String Help

I know this should be easy, but for some reason today I just can't come up
with a working solution..


The Goal:  To evaluate a string (path) and return only the end (last folder
name).

This string could end differently with or without "\"

Example: "\\adfs\ad_folder\sxpdata\Word Docs\" OR
"\\adfs\ad_folder\sxpdata\Word Docs OR C:\ad_folder\sxpdata\Word Doc\

Need to return only the "Word Docs" portion

I'm drawing a blank here....


WBR
Robert



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list