Stuart McLachlan
stuart at lexacorp.com.pg
Wed May 3 22:09:35 CDT 2006
On 4 May 2006 at 9:59, Tom Keatley wrote:
> Hi Stuart.....
>
> It seems when you assist me it always is with a Split function <grin>
>
That's because it's a very useful function :-)
> My problem in this case is this database is in A97 ....No split
> function .... Any Idea how I can solve it WITHOUT using Split?
>
You can get an A97 Split function, along with A97 versions of several other A2K functions at
http://www.tek-tips.com/faqs.cfm?fid=4342
I'd suggest you keep them all in a module that you can paste into your apps on demand :-)
If you don't want to use Split(), you could do it this way:
Dim intI As Integer
Dim intl2 As Integer
Dim strIDValue As String
Dim lngCurrentValue As Long
strIDValue = "73221,7259,13771,2"
strIDValue = strIDValue & "," 'to pick up the last value in the loop below
Do
lngCurrentValue = Val(strIDValue) 'get the first number
strIDValue = Mid$(strIDValue, InStr(strIDValue, ",") + 1) 'get rid of the first number
For intI = 0 To Me!listcon1.ListCount - 1
If Me!listcon1.ItemData(intI) = lngCurrentValue Then
Me!listcon1.Selected(intI) = True
End If
Next intI
Loop Until InStr(strIDValue, ",") = 0