By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

Calculating Sum in grid

Ali Rizwan
100+
P: 927
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.
Sep 5 '07 #1
Share this Question
Share on Google+
1 Reply


VBPhilly
P: 95
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.
Sep 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.