1 Replies - 4059 Views - Last Post: 05 October 2012 - 09:38 AM Rate Topic: -----

#1 raelkun00  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 61
  • Joined: 01-October 12

Calculate the total of first column in datagrid

Posted 05 October 2012 - 09:08 AM

Private Sub Command1_Click()
Dim total1
For i = 0 To DataGrid1.ApproxCount - 1
DataGrid1.Col = 0
total1 = Val(total1) + Val(DataGrid1.Text)
Next
txtTotal.Text = total1
End Sub



It only displays the "value of first row* the number of record"
for example:
the first row is 3 and number of record is 15 it will display "15".
I need you help please. Thanks!

correction number of record is 5. Sorry.

Is This A Good Question/Topic? 0
  • +

Replies To: Calculate the total of first column in datagrid

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Calculate the total of first column in datagrid

Posted 05 October 2012 - 09:38 AM

I'm not that clued up in the datagrid, but I would suspect that you need to increment the row, if you want to sum up the column data, otherwise you'll always stay in the first row.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1