Find first 'character' from right in a string.

The following returns the MS Access Application Path.

      Dim WRK_EXECUTABLE_PATH_210 As String
      [WRK_EXECUTABLE_PATH_210] = Application.CurrentProject.PATH
 
Example :
M:\Pgm\01-MDB-Design\SAS\Source

I want to extract the text "M:\Pgm\01-MDB-Design\SAS" from the above result where 'Source' could be any string value.  i.e. I can't use the Left or Mid Functions.

I'm doing this within a Form Event procedure.

How do I do it?

Thanks.
Bob C.
Bob_CollisonAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
IrogSintaConnect With a Mentor Commented:
Use the InStrRev function along with the Left function:
Left(WRK_EXECUTABLE_PATH_210 , InStrRev(WRK_EXECUTABLE_PATH_210, "\") - 1)

Ron
0
 
Bob_CollisonAuthor Commented:
Perfect.  Simple solution.
0
All Courses

From novice to tech pro — start learning today.