The following routine will take a string _expression and break it into
parts as set by the delimeter:
Sub StringTestMacro()
Dim MyString, MyArray, Msg
MyString = "VBScriptXisXfun!"
MyArray = Split(MyString, "X", -1, 1)
Msg = MyArray(0)
MsgBox Msg
Msg = MyArray(1)
MsgBox Msg
Msg = MyArray(2)
MsgBox Msg
End Sub
This works and its kind of neat. It returns
VBScrip
is
fun!
But, what if instead you want to replace the line
MyString = "VBScriptXisXfun!"
with a reference to a field in an Access Table or Form. How would you proceed
to reference this item??? (Suppose the Table or Form name is Table1, the field
name is Address). Should I reference the Table or Form? Conceptually I know I need to change Address to a string but I'm either brain dead, stupid or all of the above!
parts as set by the delimeter:
Sub StringTestMacro()
Dim MyString, MyArray, Msg
MyString = "VBScriptXisXfun!"
MyArray = Split(MyString, "X", -1, 1)
Msg = MyArray(0)
MsgBox Msg
Msg = MyArray(1)
MsgBox Msg
Msg = MyArray(2)
MsgBox Msg
End Sub
This works and its kind of neat. It returns
VBScrip
is
fun!
But, what if instead you want to replace the line
MyString = "VBScriptXisXfun!"
with a reference to a field in an Access Table or Form. How would you proceed
to reference this item??? (Suppose the Table or Form name is Table1, the field
name is Address). Should I reference the Table or Form? Conceptually I know I need to change Address to a string but I'm either brain dead, stupid or all of the above!