Need Urgent Help on Strip Path

M

MBoozer

Need help. I strip the filename field in the following code to only display
the true file name and not the path. This works well and strips the local
path and the HyperLinkParts. For example,
c:/whatever/whatever/whatever/egghead.pdf dispalys in filename as
"egghead.pdf". However, if the LocalScanLink is populated with a filename
from a network drive (I:/whatever/whatever/egghead.pdf) it does not strip the
path and displays the full path. I've tried all variants and know I am
missing something in the +3 part of the code?


strPath = HyperlinkPart(Me!LocalScanLink, acAddress)
If Len(strPath) > 0 Then
Me!FileName = Mid(strPath, InStrRev(strPath, "/") + 3)
Me.NOMSDS = False
End If
 
R

Rob Oldfield

Without knowing more about how your code works it's a bit tricky to be sure,
but I'd say that either HyperLinkPart isn't working because what you're
feeding it isn't a hyperlink, or that it should be a \ instead of a / for
local paths.

The best way of telling what's going on will be to step through the code and
see where it's going bang.
 
Top