If e.DataCol.Name = "ShippingNo" OrElse e.DataCol.Name = "Totalprice" Then Dim sum As Double= 0 For Each dr As DataRow In DataTables("GSSInvoice").Select("ShippingNo='" & e.NewValue & "'") sum += dr("Totalprice") Next e.DataRow("GSS_totalprice") = sum End If