?
Solved

Find first 'character' from right in a string.

Posted on 2014-10-19
2
Medium Priority
?
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

764 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