Validaltion Rule

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

I used the Not Null expression in the validation rules field of a form to
prevent users from leaving the field blank. I would also to have a text show
when the field is left blank. I have typed a validation text in the
validationt text field when the field is left empty but it does not show. The
text that comes up the system message that the field is set to true, etc. How
do I get the text that I entered in the validation text field to show?

Thanks.
 
I take it you used the Validation Rule of the text box on the form?

As you found, that doesn't work. Access performs the validation when the
user enters something, so if they don't enter anything, it doesn't fire.

Instead of using the Validation Rule of the text box on the form, use the
properties of the field in the table. Open the table in design view. Select
the field. In the lower pane of table design, either set Required to Yes, or
set the field's Validation Rule to:
Is Not Null
and the Validation Text to the message you want to see displayed.

If you want to provide a warning that the user can override (e.g. "Hey, you
left the person's surname blank. Are you really sure?"), use the
BeforeUpdate event procedure of the *form* (not control) to do that.
 
Back
Top