?
Solved

get just the last part of a file name after the last "\"

Posted on 2014-01-19
7
Medium Priority
?
245 Views
Last Modified: 2014-01-19
FileName with path:
C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle
how can i extract just the 9-spot bet 1.50.cle ?
0
Comment
Question by:isnoend2001
  • 4
  • 3
7 Comments
 
LVL 50

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 39793379
There are a couple of ways but here's one

Dim strParts As String

strParts = Split(?C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

Msgbox strParts(ubound(strParts))
0
 
LVL 50

Expert Comment

by:Martin Liss
ID: 39793381
Sorry, change

Dim strParts As String

to

Dim strParts() As String

and

Split(?C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

to

Split("C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

I apologize for the mistakes.
0
 

Author Closing Comment

by:isnoend2001
ID: 39793383
Thanks again.
Learned something unrelated.
seems Thunderbird does not show new mail icon on taskbar if inbox is not open. At least i think is why i am not getting notifications on the task bar
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:isnoend2001
ID: 39793390
Seems vb gives an error
Dim strParts As String
      strParts = Split(myfile, "\")
      Debug.Print strParts(UBound(strParts))<-- expected array
0
 
LVL 50

Expert Comment

by:Martin Liss
ID: 39793391
Sorry, can't help you with Thunderbird but once again I'm happy I was able to answer your question.
0
 
LVL 50

Expert Comment

by:Martin Liss
ID: 39793398
Sorry, can't help you with Thunderbird but once again I'm happy I was able to answer your question.
Please see my second post.
0
 

Author Comment

by:isnoend2001
ID: 39793411
gottacha missed the
Dim strParts() As String
thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

864 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