I have a mainform and a subform.
My main form contains a field called mainamount and subform contains a field called subamount. I want to make sure subamount does not excedd mainamount and i used this code in beforeupdatevent:
If [subamount] > [mainamount] Then
MsgBox ("WARNING:You have entered an amount larger that total amount!")
Cancel = True
Me.subamount.Undo
End If
but it does not work..Which part of the code do i change?