Hi all, I would like to ask how to have difference calculated value appear on report through button? I am able to click on the button on my report to perform calculation, however, all the calculated value are the same. How can i have difference calculated value for each line?
Only the first line of the calculation is correct in the image I attached.
below is my coding:
Only the first line of the calculation is correct in the image I attached.
below is my coding:
Code:
'Declare variable
Dim Lbs As Integer
'set variable to textbox
Lbs = Me.SumOfLbs
Dim GrossWeight As Integer
Dim NettWeight As Integer
NettWeight = Me.TotalNettWeight
'Lbs <130
If Me.SumOfLbs <= 130 Then
Me.TotalGrossWeight = (Me.TotalNettWeight + 20)
'Lbs <200
ElseIf Me.SumOfLbs >= 131 And Me.SumOfLbs <= 200 Then
Me.TotalGrossWeight = ((Me.TotalNettWeight * 1.15) + 15)
'Lbs <500
ElseIf Me.SumOfLbs >= 201 And Me.SumOfLbs <= 500 Then
Me.TotalGrossWeight = ((Me.TotalNettWeight * 1.1) + 10)
'Lbs <999
ElseIf Me.SumOfLbs >= 501 And Me.SumOfLbs <= 999 Then
Me.TotalGrossWeight = (Me.TotalNettWeight * 1.15)