Dim dview4 As DataRowView 'Dim dview3 As DataRowView 'Dim time_require As Integer Dim totalETR As Integer = 0 Dim ETR_array(100) As Integer Dim TotalETR_div_ETR_array(100) As Integer 'Dim ERTweight1 As Double 'Dim ERTweight2 As Double 'Dim total_ERTweight As Double Dim ERTweight2_array(100) As Double Dim Sum_weight1 As Double Dim weight1_array(100) As Double Dim weight2_array(100) As Double Dim ERTweight As Double Dim ERTweight_array(100) As Double For Each dview4 In ListBox5.Items ETR_array(size) = dview4.Row.Item(5) totalETR = totalETR + ETR_array(size) size = size + 1 Next ' This part is to retrieve all rows of the Estimated Time Required (ETR) from listbox3 (row by row) Label18.Text = "total ETR :" & totalETR.ToString For count As Integer = 0 To size weight1_array(size) = totalETR / ETR_array(size) MsgBox(totalETR / ETR_array(size)) Sum_weight1 = Sum_weight1 + TotalETR_div_ETR_array(size) size = size + 1 'MsgBox(weight1_array(size).ToString) Next count 'step1 calculation For count2 As Integer = 0 To size weight2_array(size) = (weight1_array(size) / Sum_weight1) * 10 'MsgBox(weight2_array.ToString) Next count2 'step 2 calculation

the whole idea of the coding works is as shown in the image attachment.. />/>/>

my error is the output, weight1_array(size)and weight2_array(size) which im trying to get show 'infinity'

problem : my database only have 5 rows of data but why does the lopping goes 16times..?

may i know which part goes wrong??

TQ so much for ur help and time.. Appreciate so much!