• ** There has been a recent site upgrade. Please clear your browser cache to avoid issues. **
  • New forum feature - post voting and best solution

    Check out this thread for the details: https://www.access-programmers.co.uk/forums/threads/new-forum-feature-post-voting-and-best-answer.314134/

    This new feature looks great to me! :)

  • We now have 3 forum themes

    Go for the default (light) theme, Shades of Grey or Shades of Blue. I just added the Blue one.

    The thread about it is here: https://www.access-programmers.co.uk/forums/threads/new-forum-theme-shades-of-blue.314136/

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

masons

New member
Local time
Today, 11:50
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, 16:20
Joined
May 7, 2009
Messages
10,544
here is the fix.
 

Attachments

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

masons

New member
Local time
Today, 11:50
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, 16:20
Joined
May 7, 2009
Messages
10,544
dblsumofrewards is there for You to supply the correct calculation.
 

masons

New member
Local time
Today, 11:50
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
Today, 01:20
Joined
Aug 30, 2003
Messages
34,601
The presumption was you would put your calculation of rewards there:

dblSumOfRewards = dblSumOfRewards + YourCalculationHere
 

Users who are viewing this thread

Top Bottom