I have a FORM linked to a table, this is to update the current volume with the volume taken at different levels.
Here is the code I used, some how current status Vol is not getting updated in the table and then in the FORM.
Is any thing wrong in this code? Open to any other suggestions..
Code:
Sub Volume_taken()
Dim dbs As Database
Set dbs = CurrentDb()
dbs.Execute "UPDATE [Login_test] SET [Login_test].[Current status Vol (µl)] = " & _
"([Estimated Vol Rec'd (µl)]- Nz([Vol taken (µl) 1],0)-Nz([Vol taken (µl) 2],0) - Nz([Vol taken (µl) 3],0))" & _
" WHERE [Login_test].[CSID]= " & Forms![Login_test]![CSID] & ";"
MsgBox ("Current status (Vol (µl) updated in the table!!!")
Exit Sub
dbs.Close
End Sub
Private Sub Vol_taken__µl__1_AfterUpdate()
Call Volume_taken
End Sub
Private Sub Vol_taken__µl__2_AfterUpdate()
Call Volume_taken
End Sub
Private Sub Vol_taken__µl__3_AfterUpdate()
Call Volume_taken
End Sub
CSID |
Number |
|
Number |
|
Number |
|
Number |
|
Number |
|
Number |