For various reasons, I'm stuck in Access 97 and need to get only the path part of a full pathname.
For example, the name
c:whatever diranother dirstuff.mdb
should become
c:whatever diranother dir
This site has some suggestions on how to do it: http://www.ammara.com/access_image_faq/parse_path_filename.html
But they seem rather hideous. There must be a better way, right?
You can do something simple like: Left(path, InStrRev(path, ""))
Left(path, InStrRev(path, ""))
Example:
Function GetDirectory(path) GetDirectory = Left(path, InStrRev(path, Application.PathSeparator)) End Function
2.1m questions
2.1m answers
60 comments
57.0k users