Hey pplz,
Im learning access and coming along well, but just getting my brain from macros to vba which has been recommended me learning due to their versatility!
Anyway I have
DB = ZeroIt
Tables = Stockadjustment, Stock
Query= NegStock = List Stock with negative values
SO I have a form bound to NegStock which just has the stock name and the Negative value.
I have created a button which is currently NOT working (lol) that you press to zero the stock, however instead of just StockOnHand (SOH) = 0 I need to record my adjustments in the adjustment table!
So I have made this vba module which runs but doesn't DO anything:
Code:
Private Sub Command55_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("StockAdjustment")
rs.AddNew
rs![StaffID] = 207
rs![ReasonID] = 2
rs![SOHBeforeAdj] = Me.SOH.Value
rs![SOHAfterAdj] = 0
rs![StockID] = Me.StockID.Value
rs![RealCost] = Me.RealCost.Value
rs![DateCreated] = Date
rs.Update
rs.Close
End Sub
Can someone please tell me where im going wrong!
Gangel