Sum Multiple records and display in text box #ERROR (1 Viewer)

masons

New member
Local time
Today, 15:15
Joined
Oct 7, 2020
Messages
15
i don't have the the code that you added.
i don't even know how you did it.
I didt add any code i just used the code u add and i have some problems:
hey thank u but some of points dont work corectly and show wrong numbers,
and the weird thing is when i click on each textboxs in form the form recalculate te numbers and show another number in all textboxs when i just change my focus on text boxes
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:45
Joined
May 7, 2009
Messages
19,175
here is the fix.
 

Attachments

  • access forum share.zip
    34.5 KB · Views: 104

masons

New member
Local time
Today, 15:15
Joined
Oct 7, 2020
Messages
15
here is the fix.
hey what is going on with dblsumofRewards there? i think i can remove it from there and nothing change. am i true?

Code:
Private Sub Form_Current()

    Dim dblSumOfPoints As Double
    Dim dblSumOfRewards As Double
    With Me.RecordsetClone
        If Not (.BOF And .EOF) Then
            .MoveFirst
        End If
        Do Until .EOF
            dblSumOfPoints = dblSumOfPoints + (Nz(![kpi1], 0) * Nz([Text44], 0)) + (Nz(![kpi2], 0) * Nz([Text47], 0)) + (Nz(![kpi3], 0) * Nz([Text48], 0))
            'dblSumOfRewards
            .MoveNext
        Loop
    End With
    Me!Text19 = dblSumOfRewards
    Me!Text60 = dblSumOfPoints
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:45
Joined
May 7, 2009
Messages
19,175
dblsumofrewards is there for You to supply the correct calculation.
 

masons

New member
Local time
Today, 15:15
Joined
Oct 7, 2020
Messages
15
dblsumofrewards is there for You to supply the correct calculation.
dblSumOfPoints = dblSumOfPoints + (Nz(![kpi1], 0) * Nz([Text44], 0)) + (Nz(![kpi2], 0) * Nz([Text47], 0)) + (Nz(![kpi3], 0) * Nz([Text48], 0))
'dblSumOfRewards


i mean in this code what is th meaning of dblSumOfRewards. i cant understand
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:45
Joined
Aug 30, 2003
Messages
36,118
The presumption was you would put your calculation of rewards there:

dblSumOfRewards = dblSumOfRewards + YourCalculationHere
 

Users who are viewing this thread

Top Bottom