hi this is some code someone helped me with a long time ago, and i am trying to go thro all the codes i have been given help with to try and understand how they work for future
this code works great but i am total confused how it gets the oldvalue as i have no feild anywhere calling it up
steve
this code works great but i am total confused how it gets the oldvalue as i have no feild anywhere calling it up
steve
Code:
Private Sub StockQty_AfterUpdate()
Dim OldValue As String
Dim NewValue As String
Dim MaterialID As Double
MaterialID = Me.MaterialID
OldValue = Me.StockQTY.OldValue
NewValue = Me.StockQTY
DoCmd.RunSQL "INSERT INTO TblDataChanges ( MaterialID, ChangeDate, ControlName, OldValue, NewValue ) VALUES ('" & MaterialID & "',Now(),'stockqty' ,'" & OldValue & "', '" & NewValue & "');"
Exit Sub
End Sub