Quote:
Originally Posted by viv345 View Post
getting problem in calculating row by row?
Project attached

programming is not just a copy paste

Code:
Private Sub cmdtotalrow_Click()
Dim i, a As Integer
a = 0
'Iteration for col by col for selected row
For i = 0 To Adodc1.Recordset.Fields.Count - 2
    'Calculate the result
    MsgBox DataGrid1.Columns(i).Text 'add this command and see what you add
    a = a + Val(DataGrid1.Columns(i).Text)
Next
MsgBox "result=" + CStr(a)
Text8.Text = CStr(a)
Adodc1.Recordset.MoveFirst
End Sub