How can I add up a value to the current recordset value when editing a table?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Edu Castro
    New Member
    • May 2011
    • 1

    How can I add up a value to the current recordset value when editing a table?

    here is my code I can edit the current rs value, but this code is replacing the existing one. Instead I need the code to add a new value to the existing one

    Code:
    If rs31![POID] = rs32![POID] And rs31![MRP Date] < rs32![Pstg Date] Then
    rs31.Edit
    rs31![QTY ACC] = rs32![QTY ACC]
    rs31.Update
    In other words I need rs31 to be equal rs32 + current value in rs31.

    Any help on that pls?
    Last edited by NeoPa; May 10 '11, 11:22 AM. Reason: Added CODE tags for you. Please remember for next time.
  • gnawoncents
    New Member
    • May 2010
    • 214

    #2
    If I understand you correctly, if rs31![QTY ACC] is 5 and rs32![QTY ACC] is 6, then you want rs31![QTY ACC] to be 11, right? If so, try:

    Code:
    If rs31![POID] = rs32![POID] And rs31![MRP Date] < rs32![Pstg Date] Then
    rs31.Edit
    rs31![QTY ACC] = rs31![QTY ACC] + rs32![QTY ACC]
    rs31.Update

    Comment

    Working...