G
Guest
I created a form where the user has to enter data. For one of the fields, I
would like to validate their data entry. I want to create an error message,
if the user does not enter "PK" or "TR" into this field. However, with the
below code, when I type "TR" or "PK" into the field it gives me the error
message("You must enter PK or TR"). Can you tell me what is wrong with my
code?
If (Me.Division<>"TR" Or Me.Division <> "PK") Then
Docmd.CancelEvent
returnvalue=Msgbox("You must enter PK or TR", vbCritical, "Required")
would like to validate their data entry. I want to create an error message,
if the user does not enter "PK" or "TR" into this field. However, with the
below code, when I type "TR" or "PK" into the field it gives me the error
message("You must enter PK or TR"). Can you tell me what is wrong with my
code?
If (Me.Division<>"TR" Or Me.Division <> "PK") Then
Docmd.CancelEvent
returnvalue=Msgbox("You must enter PK or TR", vbCritical, "Required")