Data Validation Rules

S

Sandi

I have a data base that a lot of fields need to be required. I have set the
Required field in the table to Yes, and I also want to set up Validation
Rules and text so that they can not skip over fields. The only thing is I
don't know what to set up inside my Validation Rule in the table to equal or
read or anything. Any help would be appreciated.

Thanks
Sandi Gardner
 
B

Brendan Reynolds

If you mean that you want to use a validation rule to ensure that the user
does not leave the field blank, you can do it, but there is no point in
doing it if the Required property is set. The Required property is enforced
first, before the validation rule, so the validation rule will never be
fired, and the user will never see your validation text.

A validation rule to require the user to enter a value in a text field might
look something like this ...

Is Not Null And <>""

Those are two double quotes with nothing between them at the end.
 
S

Sandi

You're right. I took out the required field and changed it back to No and
put in the Data Validation that you suggested and it works great. My one
last question is what about date/time fields. Do I use the same expression
for the text as before or will it be different for dates?
 
V

Van T. Dinh

In the Table Design View, select a Field and then look in the "General" tab
of the lower left pane, you should see the Properties "Validation Rule" and
"Validation Text". You can also use Table Validation for cross-Field
validation.

In Forms, editable / data-aware Controls such as TextBox, ComboBox also have
the Properties "Validation Rule" and "Validation Text" in the "Data" tab of
the Properties window for the Control. In addition, you can also use the
BeforeUpdate Event (of the Control or the Form) to perform validation check
by code).

Most of the above are covered in Access Help. Type "Validate" in the
SearchBox and you should see a number of Help topics on data validation.
 

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