the form below shows me the 2 item i have purchased
the middle sub form tell us what is received and in that form i tick the box " stock change "
the form below that then changes the "on order qty" and the stock qty this is done by a query
i have some vba that when i manually change the stock qty it
goes to a table with all the changes that have been made see below
i was hoping this would work after i ticked the " stock change" button as the quantity has changed but it dont , and ideas on how to do that
i also have 4 forms that are related to the stocklist table of which any of them 4 can change the stock qty. so is there a way that i ont have to put this code on all 4 forms attached to the stock qty field
thanks steve
the middle sub form tell us what is received and in that form i tick the box " stock change "
the form below that then changes the "on order qty" and the stock qty this is done by a query
i have some vba that when i manually change the stock qty it
goes to a table with all the changes that have been made see below
i was hoping this would work after i ticked the " stock change" button as the quantity has changed but it dont , and ideas on how to do that
i also have 4 forms that are related to the stocklist table of which any of them 4 can change the stock qty. so is there a way that i ont have to put this code on all 4 forms attached to the stock qty field
thanks 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