Use InStrRev:
Dim intI As Integer
' Strip off the last \
strPath = Left(strPath, Len(strPath) - 1)
' Now find the \ in front of the last path
intI = InStrRev(strPath, "\")
' Dump the extra path
strPath = Left(strPath, intI)
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Dec 28, 2013, at 10:46 PM, <glcass58@yahoo.com> <glcass58@yahoo.com> wrote:
Hi all,
This is probably a simple question but I just can't seem to figure it out! In my recordset I have a field that is a folder path. I need to take the folder path and trim off the last folder level. So I want to take this:
"C:\mainpath\subfolder\subfolder\"
and trim it to:
"C:\mainpath\subfolder\"
The number of subfolders and subfolder names will vary with each record.
Thanks in advance for your help!!!
__._,_.___
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar