up on dir in FilePath

2wistd

Registered User.
Local time
Today, 03:06
Joined
Jan 17, 2013
Messages
66
FilePath = CurrentProject.path

I am currently using this path, but I moved my database folder into another folder so people won't mess with it. I still need to create files to the original directory. How can I make the FilePath still relative but up one folder from CurrentProject.path?
 
Clip out the last folder with InStrRev?

Or if you won't be moving it very often, you can be lazy and just hardcode the folder.
 
Thanks,

Can't hardcode, knowing this place they'll require the folder name/location be changed plenty and there are quite a few references to the path in the code.

I'll have to figure out this InStrRev thing, I saw something on google just couldn't get it to work.
 
Awesome, took a little but I was able to get it figured out.

Thanks again!
 
Yeah the biggest trick with InStrRev is that it counts from the BEGINNING even though it's looking from the END. So you have to use Mid(), not Right().
 
Last edited:
To go one folder up, simply append two dots to the path as a "folder"

currentproject.path & "..\"
 

Users who are viewing this thread

Back
Top Bottom