Validaltion Rule

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.
 
A

Allen Browne

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.
 
P

Pete

OK - How would I prevent the user from leaving a field blank in an Access
Data Project?
 

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

Top