How to split up this string

davesmith202

Employee of Access World
Local time
Today, 03:25
Joined
Jul 20, 2001
Messages
522
I have a string:

Cars > Car Import > Car Import: Car Import

The first section is the Category, the second is the Product, the third is the SubProduct and the fourth is the keyword.

What is the best way to split each of these words into its own variable? I think I can do the first and end one but not the Car Import and Car Import one.

Thanks,

Dave
 
So would I do something like this?

myArray(x)=split(myString,">") or something?

I can't find an example in Access help.
 
Code:
Const TestString As String = "Cars > Car Import > Car Import: Car Import"

Dim strText As String
Dim strParts() As String
Dim intCounter As Integer

strText = Replace(TestString, ":", " >")
strText = Replace(strText, " > ", ">")

strParts = Split(strText, ">")

For intCounter = LBound(strParts()) To UBound(strParts())
    MsgBox strParts(intCounter)
Next intCounter
 

Users who are viewing this thread

Back
Top Bottom