Hey All,
Please help me out from 1 error...its bugging me from a long i.e. Run time error 7878 : The data has been changed.
I had searched a lot but didn't find the relevant reply anywhere.
Actually I have 2 buttons in my subform named as : Outward & Inward
On each button clk I want to perform 2 operations:
1. Stock in Dbs updated i.e. for Outward button if Inventory is 100 and i want 10 to be out from stock. if clk
2. updatd quantity & out stock get inserted in my log file.
Here is my Code for the same:
Private Sub Command29_Click()
Dim con3 As Object
Set con3 = CreateObject("ADODB.Connection")
con3.Open "dsn"
DoCmd.RunCommand acCmdSaveRecord
rs = con3.Execute("update [Inventory Transactions] set Quantity= " & Quantity.Value - Outward.Value & " where [SKU Code]= '" & [SKU Code].Value & "' and Location= '" & Location.Value & "' and Quantity>= " & Outward.Value)
con3.Execute "INSERT INTO Log_File ( [SKU Code], Location, Quantity, Outward, Inward )SELECT [Inventory Transactions].[SKU Code], [Inventory Transactions].Location, [Inventory Transactions].Quantity, [Inventory Transactions].Outward,[Inventory Transactions].Inward FROM [Inventory Transactions] where [SKU Code]= '" & [SKU Code].Value & "' and Location= '" & Location.Value & "'"
MsgBox "Outward Done Successfully"
con3.Close
Outward.SetFocus
Outward.Text = ""
End Sub
Please assist me for the same.
Thanks in advance...