Validation Rule & Text

C

CP

Hi: I have a text box on a form and when I enter "KTU" in this text feid I am
hoping to have a Rule & Text set up to identify it and reflect a message box
when KTU is entered. Is there an easy expression for that? Thanks.
 
A

Al Camp

CP,
Use the AfterUpdate event of the field to run this code.

If YourFieldName = "KTU" Then
MsgBox "Warning... You have entered KTU"
End If
 
C

CP

Hi Al:

Would it soemthing like this:
Private Sub HRA_Directory_AfterUpdate()
If HRA Directory = "KTU" Then
MsgBox "Move entire Directory when moving KTU"
End If

End Sub
 
A

Al Camp

Yes, except that if your field name is truly HRA Directory (as you typed it), then
bracket the field.
[HRA Directory]
This must be done on any field name that contains spaces. That's why it's good practice
to avoid spaces in object names...

HRADirectory
would not require bracketing...
 
Top