[Originally posted by Yousuf]
Dear Guys,I want to sum a column of datagrid. I tried
the following code. But it never refreshes the result.
It shows the result after two events.Is there anycode
to solve this problem. Actually I wanted to sum the
datagrid directly without using sql. Can you post
sample code please. Thanks a Lot in advance.
Here is my code:-
Private Sub DataGrid1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
KeyAscii = 0
If DataGrid1.Col = 4 Then 'Price column
Dim totals As New ADODB.Recordset
Totaltxt.Text = ""
totals.Open "select sum(PrdPrice * qty) as t
from TempInv", con, _
If IsNull(totals!t) Then
Totaltxt.Text = totals!t
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center