I have an array like this:
jack,33500;luci,36120;andro,33941;jenifer,25980;ivanka,12500
I want to find for instance "andro" when I write 33941 in my textbox.
Note: I found out many code in other programming method, but I need to get code for using in MS Access.
My codes is like below. when i click in listbox my array is built and at the same time I expect showing result but it apparently get back an error (substring out of range) codes:
Private Sub txNumber1_Click()
Dim CurMobile As String, curMesssage As String, strMobiles As String, strMesssages As String, strMM As String
Dim rowNum As Variant
Dim TestArrayMobile() As String
Dim TestArrayMessage() As String
Dim arr() As String
Dim i As Integer
Dim j As Integer
' Get selected phone numbers & names
With txNumber1
For Each rowNum In .ItemsSelected
CurMobile = .Column(1, rowNum)
curMesssage = .Column(3, rowNum)
strMM = strMM + ";" + curMesssage + "," + CurMobile
arr() = Split(strMM, ";")
For j = LBound(arr) To UBound(arr)
' MsgBox arr(j, 1), , arr(j, 0)
MsgBox arr(j, 1)
' If StrComp(.Column(1, rowNum), arr(j, 1), vbTextCompare) = 0 Then
' MsgBox arr(j, 0)
' Exit For
' End If
Next j
Next rowNum
End With
End Sub