D
David G.
I'm inspecting/parsing a user input string, starting near the end and
working to the beginning.
code:
i = Len(strApplication(iRecords, 1))
While Asc(Mid(strApplication(iRecords, 1), i, 1)) >= 48 And
Asc(Mid(strApplication(iRecords, 1), i, 1)) <= 57
i = i - 1
Wend
end code
The problem occurs when the code does not find any non-numeric
characters; i eventually becomes "0" which causes the "Mid" function
to raise an error.
I added "And i > 0" to the "While" clause, but VBA tests all three
conditions.
Any suggestions?
Thanks!
THANKS!
David G.
THANKS!
David G.
working to the beginning.
code:
i = Len(strApplication(iRecords, 1))
While Asc(Mid(strApplication(iRecords, 1), i, 1)) >= 48 And
Asc(Mid(strApplication(iRecords, 1), i, 1)) <= 57
i = i - 1
Wend
end code
The problem occurs when the code does not find any non-numeric
characters; i eventually becomes "0" which causes the "Mid" function
to raise an error.
I added "And i > 0" to the "While" clause, but VBA tests all three
conditions.
Any suggestions?
Thanks!
THANKS!
David G.
THANKS!
David G.