Hello Guys, please help
I have this piece of code in my UserForm_Initialize():
r = 0
ReDim MyArray(MyArray_Upto - 1, 5)
Do While Not Rs.EOF
MyArray(r, 0) = Rs.Fields(4)
MyArray(r, 1) = Rs.Fields(5)
MyArray(r, 2) = Rs.Fields(6)
MyArray(r, 3) = Rs.Fields(13)
MyArray(r, 4) = Rs.Fields(14)
MyArray(r, 5) = Rs.Fields(179)
MyArray2(r) = Rs.Fields(4) & " " & Rs.Fields(5) & " " & Rs.Fields(6) & " " & Rs.Fields(13) & " " & Rs.Fields(14) & " " & Rs.Fields(179)
Rs.MoveNext
r = r + 1
Loop
LstPolicies.List() = MyArray2
Rs.Close
I assign to my listbox (LstPolicies) already set in my form and the content from Array2 and I have another Var (MyArray) for keeping each row and column reference from the Record Set. So, I get successfully my listbox filled with MyArray2 and MyArray keeps the matrix by rows and columns for some SELECT.. WHERE queries, so far so good. MY PROBLEM STARTS when I click on my Listbox to choose any option. When the sequence of process start the click event my variables Myarray and MyArray2 set in "Out of Context". However, I have defined both of them as a Public variables in the top of the module showing my form.
I will appreciate if somebody can help me. Any advice or suggestion?
Thanks in advance guys
GONFER