record validation rule

R

Ritz

I am trying to write a rule so my [ReceiptAmount] is >0 if my [Transaction#]
starts with 70 or my [PaymentAmount] is >0 if my [Transaction#] starts with
19. Can anyone please help?
 
A

Arvin Meyer [MVP]

Use the BeforeUpdate event of the form. (aircode):

Sub Form_BeforeUpdate(Cancel As Integer)
If Left(Me.[Transaction#], 2) = 19 or Left(Me.[Transaction#], 2) = 70 Then
If Me.[[ReceiptAmount]<=0 Then
MsgBox "The ReceiptAmount must be greater than 0.", vbOKOnly, "Data
Entry Error"
Cancel = True
End If
End If

End Sub
 
Top