I have an Access database that stores file paths. Sometimes the documents get thrown into an "archive" sub folder. I've created a form that loads the record with the file name and file path. On the form I created a button that adds \archive\ into the existing file path. The \archive\ needs to be inserted after the last backslash found in the file path. Here's the function I've tried but I can't find the solution anywhere.
Public Function insertArch (ByVal strPath As String)
insertArchive = InStrRev(strPath, "\") + " archive\"
End Function
I'm trying to find the first backslash from the end of the string, and then want to insert archive\. What am I doing wrong?