Private ServiceType() as string
Form_Initialize 'or Class_Intitialize
ServiceType = Split("ITEM1,ITEM2,ITEM3,ITEM4,ITEM5",","
End Sub
In a Sub or Function
.... SUb ....
Static ServiceType() as String
Static blnInit as Boolean
if blnInit = false then
ServiceType = Split("ITEM1,ITEM2,ITEM3,ITEM4,ITEM5",","
blnInit = True
end if
End Sub
Change if "," can occur in data the substitute "~" or whatever.
The best you can do is what JohnYingling is pointing out:
1. Create a string constant with a delimiter
Const ServiceType$ = "ITEM1, ITEM2, ITEM3, ITEM4, ITEM5"
When needing to access the elements you could use the Split function to create an array out of the string:
Dim myArray() As String
Also as JohnYingling pointed out, you need to select a delimter that isn't already used in one of the items. A Tab delimeter may be good to use:
Const ServiceType$ = "ITEM1" & vbTab & "ITEM2" & vbTab & "ITEM3" & vbTab & "ITEM4"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.