Calculating Sum in grid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    Calculating Sum in grid

    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.Captio n = Text3.Text
    timCalc.Enabled = False

    ADATA1.Refresh
    Text3.Text = 0
    timcalc1.Enable d = 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.
  • VBPhilly
    New Member
    • Aug 2007
    • 95

    #2
    Originally posted by Ali Rizwan
    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.Captio n = Text3.Text
    timCalc.Enabled = False

    ADATA1.Refresh
    Text3.Text = 0
    timcalc1.Enable d = 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.

    Comment

    Working...