Brett Barabash
BBarabash at TappeConstruction.com
Tue Feb 4 08:28:00 CST 2003
Well, you could just manually parse each character in the string going
backwards:
Function ReturnLastWord(ByVal strIn As String) As String
Dim lngCtr As Long
For lngCtr = Len(strIn) To 1 Step - 1
If Mid$(strIn, lngCtr, 1) = " " Then
ReturnLastWord = Mid$(strIn, lngCtr + 1)
Exit Function
End If
Next lngCtr
End Function
-----Original Message-----
From: Terri Jarus [mailto:jarus at amerinet-gpo.com]
Sent: Tuesday, February 04, 2003 8:20 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Parsing Strings-UPDATE
This was exactly what I needed. However, InStrRev is not available in 97 -
I have both 97 and XP, so was able to extract what I needed. How would it
work for 97 though??
Thanks again for the help. I have a mental block about a lot of things -
working with strings tops the list. I am keeping the solution for future
reference.
>>> BBarabash at tappeconstruction.com 02/03/03 09:07AM >>>
Oops!
I meant to say:
Mid$(MyString,InStrRev(MyString," ")+1)
(looks like somebody has a case of the Mondays)
-----Original Message-----
From: Brett Barabash
Sent: Monday, February 03, 2003 9:00 AM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] Parsing Strings
Hi Terri,
If you are trying to extract the last word from the string, you could use
InStrRev to do this:
Right$(MyString,InStrRev(MyString," ")+1)
-----Original Message-----
From: Terri Jarus [mailto:jarus at amerinet-gpo.com]
Sent: Monday, February 03, 2003 8:22 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Parsing Strings
I know this is very easy, but I can never remember exactly how to do this.
I need to parse off some data from the end of a string. For example, the
string:
FLDR T TAB M CLIP#5 BLUE 11PT; 2 PLY STRAIGHT CUT 250/CS
I want to parse out "250/CS". How do I set up the code to do this? This
info is always going to be at the end of the string.
Thanks for your help. If there is a website or information that I can put
in my files as to how to work with strings, I could reference that in the
future.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030204/21ffedbf/attachment-0002.html>