[RESOLVED] ms access query/ form accumulate value
I have an ms query with items and values. I'd like to create a form based on it with a third column holding the accumulated value. for example:
item......price.......accum price
1...........1.5..............1.5
2...........2................3.5
3...........1................4.5
Re: ms access query/ form accumulate value
VB Code:
Dim rst As Recordset
Dim prevval As Double
Set rst = CurrentDb.OpenRecordset("select * from table1")
While Not rst.EOF
rst.Edit
rst("accum") = prevval + rst("price")
rst.Update
prevval = rst("accum")
rst.MoveNext
Wend
where table1 is ur table (not a query) containing the items and values..
If ur problem got resolved,then please rate the post..
Re: ms access query/ form accumulate value