Hello!
I'm working on VBA within MS Access XP, and can't seem to get the proper usage of the split function down. I've been trying to make this work, but I keep getting the "Run-time error '9': Subscript out of range" error.
Since the code of my project is kind of long, I'll try to stick to the most relevant part- can someone please explain to me where I'm going wrong?
'Declare your Dims:
Dim InputString As String
Dim NewArray As Variant
Dim NewArrayKey0 As String
'Give the InputString variable a value:
InputString = "input string"
'Split the InputString variable into two parts,
'separated by the default delimiter, the space:
NewArray = Split(InputString)
'Assign the first key of the array to NewArrayKey0 variable:
NewArrayKey0 = NewArray(0)
'Display the value of NewArrayKey0 (It should be the word "input") in a message box:
MsgBox NewArrayKey0
Thank you!
-jay