Solved

Find first 'character' from right in a string.

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now