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

masons

New member
Local time
Today, 06:16
Joined
Oct 7, 2020
Messages
14
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

error reading drive A:
Local time
Today, 10:46
Joined
May 7, 2009
Messages
10,883
here is the fix.
 

Attachments

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

masons

New member
Local time
Today, 06:16
Joined
Oct 7, 2020
Messages
14
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

error reading drive A:
Local time
Today, 10:46
Joined
May 7, 2009
Messages
10,883
dblsumofrewards is there for You to supply the correct calculation.
 

masons

New member
Local time
Today, 06:16
Joined
Oct 7, 2020
Messages
14
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
Yesterday, 18:46
Joined
Aug 30, 2003
Messages
34,752
The presumption was you would put your calculation of rewards there:

dblSumOfRewards = dblSumOfRewards + YourCalculationHere
 

Users who are viewing this thread

Top Bottom