If I have a string containing the path and file name
ex:
"c:\windows\desktop\mh.xls"
how can I trim off the path and just return the file name
"mh.xls"
?
Thanks
Use the INSTR() function to look for the last "\" (I believe you can search from the right by using a negative number) and then get the characters from the right of that last slash by using the RIGHT function. Look these two up in help for more info... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
If you are using Ms. Acceess 2K, use the SPLIT function. the last element of the array will be the file name.
If you have an earlier ver, there is a routine "basSplit" (and some other similar ones) posted in various threads which will also do this.
If you do not have the patience to wait for the search enging to be returned to service, Terry's suggestion to use InStr and Right is an appropiate way to do it, although I do not recall ... "(I believe you can search from the right by using a negative number) .
MichaelRed
redmsp@erols.com
There is never time to do it right but there is always time to do it over
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.