For the total, you have, at least, 2 choices
First: You can write a bucle that reads cells in the column corresponding to the field that you want sum. It´s some like this:
dim i
dim sum
DataGrid1.Col = ? '?=Index of column you want sum
for i = 0 to 20
DataGrid1.Row = i
sum = sum + Val(DataGrid1.Text)
next i
Print sum
Second: DataGrid updates DataSource automatic, then you can use Sum in a SQL expression through ADO. By example:
dim con as Connection
dim rs as Recordset
dim sql as String
sql = "SELECT Sum(YourField) AS SumYourField FROM YourTable"
con.Open "YourConnectionString or YourDSN"
set rs = con.Execute(sql)
Print rs("SumYourField")
I hope you are satisfied.
glurrea
glurrea