Solved

Find first 'character' from right in a string.

Posted on 2014-10-19
2
158 Views
Last Modified: 2014-10-19
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.
0
Comment
Question by:Bob_Collison
2 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 500 total points
ID: 40390116
Use the InStrRev function along with the Left function:
Left(WRK_EXECUTABLE_PATH_210 , InStrRev(WRK_EXECUTABLE_PATH_210, "\") - 1)

Ron
0
 

Author Closing Comment

by:Bob_Collison
ID: 40390230
Perfect.  Simple solution.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question