silentwolf
Well-known Member
- Joined
- May 14, 2008
- Messages
- 1,216
- Office Version
- 2016
Hi guys! Sorry not here that often but when I need help
I got this custom function below it is I guess simple but I am struggling a little ..
Now as I am using this function in a query there are not always slashes in the string I am looking for.
So how do I modify this function so that it only displays the last string after the slash..
For example... if there is no slash in the text I am looking for just keep it blank.
Currently I am getting an Error ..
Hope someone could give me a help with this!
Many thanks
Albert
I got this custom function below it is I guess simple but I am struggling a little ..
Code:
Function LastSlash(strText As String) As String
Dim intPos As Integer
intPos = InStrRev(strText, "/")
LastSlash = Mid(strText, intPos + 1)
End Function
Now as I am using this function in a query there are not always slashes in the string I am looking for.
So how do I modify this function so that it only displays the last string after the slash..
For example... if there is no slash in the text I am looking for just keep it blank.
Currently I am getting an Error ..
Hope someone could give me a help with this!
Many thanks
Albert