I have a recordset which holds data from a query. Data is something like this?
Name---- R1 ---- R2 ---- R3
A-------- 1 ---- 2 ---- 3
B-------- 2 ---- 3 ----- 4
C-------- 3 ----- 4 ----- 5
What I want is to transfer R1, R2 and R3 values for A,B and C to an array and then calculate median of that array and display the median value in a Grid for each Ratios (R1,R2,R3). Below is my code:
The problem is that Array contains only last value of R1 not all the value of R1. Any help or any suggestion to solve the problem.Code:Do While Not adoPrimaryRS.EOF For i = 0 To adoPrimaryRS.Fields.Count - 1 If adoPrimaryRS.Fields(i).Name = "R1" Then .TextMatrix(lngRow, lngCol) = Format(adoPrimaryRS.Fields(lngRow).Value, "0#.00") intArray(i) = Format(adoPrimaryRS.Fields(i).Value, "0#.00") End If Next i 'move on to next record adoPrimaryRS.MoveNext
Thanks




Reply With Quote