I am trying to use the Split() function to parse a long string of data separated by the * symbol in a field. Here is an example of what this string looks like -
Expand|Select|Wrap|Line Numbers
- 00A398390*330861255*RIVERSIDE REGIONAL PEDIATRIC M
Using the above example I get the result I want...
Expand|Select|Wrap|Line Numbers
- SplitJEDI_NPI("00A398390*330861255*RIVERSIDE REGIONAL PEDIATRIC M")
- Returns this: 330861255
This is what it looks like in the query grid, which results in #Error:
Expand|Select|Wrap|Line Numbers
- Expr1: SplitJEDI_NPI([CAPRVSOURCE])
Can anyone help me out? Thank you in advance!
Expand|Select|Wrap|Line Numbers
- Public Function SplitJEDI_NPI(ByVal InputString As Variant)
- Dim strInput As String
- 'Declare an array that will hold data elements
- Dim strArrayNPI() As String
- Dim strResult As String
- strInput = InputString
- 'Debug.Print strInput
- Erase strArrayNPI
- 'Split input string and store as an array
- strArrayNPI = Split(strInput, "*")
- 'Trim the results
- strResult = Trim(strArrayNPI(0))
- Debug.Print strResult
- SplitJEDI_NPI = strResult
- End Function