Hi
i m using this code for claculating total expenses of month, in timer.
Text3.Text = Val(Text3.Text) + Val(Text2.Text)
If ADATA.Recordset.EOF Then
lblTotal.Caption = Text3.Text
timCalc.Enabled = False
ADATA1.Refresh
Text3.Text = 0
timcalc1.Enabled = True
Else
ADATA.Recordset.MoveNext
End If
if there is any convenient and quick way to find sum of all expense then plz tell me.
Youve got a recordset, presumably through an data control.
I also suspect youve got textboxes binded to the data control.
Your doing calculation at the client. This might be good.
However, you may want to get calculations from your database. But, since you do not show how the datasource is implemented, it is difficult to provide the best answer.
Assuming values are saved dynamically (through the data control), run a query to get results. You can tie this in with a new data control and use binding to show results.