Need Urgent Help on Strip Path

G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top