Hi Micron,
Thanks for the fast response. I was referring to the After Update Event on the subform, not the main form. I have tried this before where I use VBA in the After Update Event to check the entered value against another. I talked about it in another forum post and June7 helped me figure out why it was only working occasionally and not all the time. According to her, records must be committed to the database before being called upon in VBA.
I'm okay with code, I'm a beginner, but I'm catching on quickly. Neither the subform nor main form are bound to anything.
Below is the VBA I wrote for another subform After Update Event. The problem is that it only works sometimes. I believe it has to do with when Access saves your work because as I said, June7 mentioned the record needing to be committed first before code would work. Can you verify that?
Code:
Private Sub Weight_AfterUpdate()
DoCmd.Save
If DLookup("SumOfWeight", "qry_BP40_BlendingCheck_Pt1") > DLookup("Quantity", "qry_BP40_BlendingCheck_Pt2") Then
Output = MsgBox("Mix exceeds quantity from formula.", vbCritical, "Error") = vbAbort
Me.Weight.Value = "0"
End If
End Sub