D
Donald King
Report forms have a running sum property for calculating a running sum of a
total field. I took a stab at writting my own RunSum procedure for a form
but just shows the total all the way down the form. This form is connected
to a Query with a one to many relationship of Stock Items on the main form
and Transactions in the sub-form. In the subform's code I wrote the falling
procedure and added the RunSum in the AfterUpdate events of the
txtbxUnitsReceived and the txtbxUnitsXferred:
Private Sub RunSum()
Dim nSum As Integer
With Me.RecordsetClone
.MoveFirst
While Not .EoF
nSum = nSum + Me.UnitsReceived 'Items received to the equip. yard
nSum = nSum - Me.UnitsXferred 'Items transferred out of the yard
Me.txtbxUnitsOnHand = nSum
.MoveNext
Wend
End With
End Sub
Any suggestions would be greatly appreciated,
Don
total field. I took a stab at writting my own RunSum procedure for a form
but just shows the total all the way down the form. This form is connected
to a Query with a one to many relationship of Stock Items on the main form
and Transactions in the sub-form. In the subform's code I wrote the falling
procedure and added the RunSum in the AfterUpdate events of the
txtbxUnitsReceived and the txtbxUnitsXferred:
Private Sub RunSum()
Dim nSum As Integer
With Me.RecordsetClone
.MoveFirst
While Not .EoF
nSum = nSum + Me.UnitsReceived 'Items received to the equip. yard
nSum = nSum - Me.UnitsXferred 'Items transferred out of the yard
Me.txtbxUnitsOnHand = nSum
.MoveNext
Wend
End With
End Sub
Any suggestions would be greatly appreciated,
Don