Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cumulate value in grid

Status
Not open for further replies.

RSX02

Programmer
May 15, 2003
467
CA
Hi
I have a grid with 2 columns
One column is the line of my order
the other column is the qty that I shipped.
What I would like to do is to cumulate all column that the line are the same.
For example
I have these record

Line QTY
1 12
2 10
2 10
3 14

I would like to cumulate the line 2 in a variable to have a qty of 20.

I tried this but it doesn't work (it put nothing in my variable)

Do While i <= ThisForm.PrimaryCache.GetNumEntries
If i = 0 Then
ThisForm.Variables(&quot;QtyVar&quot;).Value = ThisForm.GetObjectProperty(&quot;UbQtyToShpConvGridCol&quot;, i)
Else
If ThisForm.PrimaryCache.GetObjectProperty(&quot;CoLineGridCol&quot;, i) = ThisForm.PrimaryCache.GetObjectProperty(&quot;CoLineGridCol&quot;, i - 1) Then
ThisForm.Variables(&quot;QtyVar&quot;).Value = ThisForm.Variables(&quot;QtyVar&quot;).Value + ThisForm.Components(&quot;UbQtyToShpConvGridCol&quot;)
Else
ThisForm.Variables(&quot;QtyVar&quot;).Value = ThisForm.PrimaryCache.GetObjectProperty(&quot;UbQtyToShpConvGridCol&quot;, i)
End If
End If
i = i + 1
Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top