record validation rule

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top