Count Command...Maybe?

rjusa

New member
Local time
Today, 05:23
Joined
Feb 27, 2003
Messages
7
Thanks to Pat, I've come up with the following code:

Sub Macro69()
Dim Mystring As String, MyArray, Msg
DoCmd.OpenForm "String"
Mystring = Forms!String!Address
MyArray = Split(Mystring, "*", -1, 1)
Msg = MyArray(0)
MsgBox Msg
Msg = MyArray(1)
MsgBox Msg
End Sub

Returned excatly what I needed. Thank you Pat! Next, my question is:

I knew apriori how to set the MyArray parameters (i.e., 0, 1)...since I don't have this luxury in the real world, how can I incorporate code to count the number of times the "*" character occurs (n) and then alter the existing code to tell MyArray to loop(?) 1 to n times?
 

Users who are viewing this thread

Back
Top Bottom