Solved

Find first 'character' from right in a string.

Posted on 2014-10-19
2
159 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

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.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

733 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