davids26
Jan 10th, 2006, 12:59 PM
Ok....
I have an item form with a field called Stock in it. This is the current stock of each particular item.
In my Sale form I have added a subform of my item form as some had suggested this too me.
I click add record choose the item that has been sold from a combo box, i then choose how many are sold and the date of when they were sold.
Then i click save record to keep it. When i press this i want it to update the current stock by subtracting the quantity sold to get a new value.
This is the code i currently have for my Save button
Private Sub save_Click()
Dim stock As Integer
stock = stock - Quantity
On Error GoTo Err_save_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_save_Click:
Exit Sub
Err_save_Click:
MsgBox Err.Description
Resume Exit_save_Click
End Sub
But it doesn't work.
I hope this explains my problem.
Edit: Fixed tags. - Hack
Andrew
I have an item form with a field called Stock in it. This is the current stock of each particular item.
In my Sale form I have added a subform of my item form as some had suggested this too me.
I click add record choose the item that has been sold from a combo box, i then choose how many are sold and the date of when they were sold.
Then i click save record to keep it. When i press this i want it to update the current stock by subtracting the quantity sold to get a new value.
This is the code i currently have for my Save button
Private Sub save_Click()
Dim stock As Integer
stock = stock - Quantity
On Error GoTo Err_save_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_save_Click:
Exit Sub
Err_save_Click:
MsgBox Err.Description
Resume Exit_save_Click
End Sub
But it doesn't work.
I hope this explains my problem.
Edit: Fixed tags. - Hack
Andrew