Validation Rule

T

Tru

What is the Validation Rule for a Null Value in a table, because I am trying
to eliminate Access's confusing error message and create a simpler Validation
Text Error Message.
 
J

Jeff Boyce

Tru

Not sure I understand the context of your reference to "the Validation Rule
for a Null Value". When are you seeing the related error message?

If you try to enter a new row/record and have not provided a value for a
field that has its "Required" property set to "Yes", you have violated the
definition of the table. A few obvious solutions are to make the field not
required, put something in it, or also change the "Allow Zero-Length
Strings" property to "Yes" (but this one adds other complications).
 
T

Tru

I want the field required but I do not like the error message Access displays
when the field is null. I just want to be able to display my own error
message in the validation text property. That's why I need to know what to
indicate in the Validation Rule to check for Null values.
 
J

Jeff Boyce

Tru

I suppose you could try Not Null (but I'm not sure if Access checks it's own
internal table properties before checking the Validation rule ...

Worth a test, no?

Jeff Boyce
<Access MVP>
 
T

Tru

Yeah I tried "Is Not Null" I still receive the standard error message. You
know the standard error message would not be that bad it it did not include
the table name and the table field name.

Jeff, thanx for taking time out to try and help me out.
 
J

Jeff Boyce

Hmmm...? What if you added a check in the BeforeUpdate event of the control
on your form? You could test for Null and cancel the update of that
(table's) field...

Jeff Boyce
<Access MVP>

Tru said:
Yeah I tried "Is Not Null" I still receive the standard error message. You
know the standard error message would not be that bad it it did not include
the table name and the table field name.

Jeff, thanx for taking time out to try and help me out.
 
T

Tru

Jeff I finally figured it out would you believe all you have to do is change
the Required from yes to no, put "Is Not Null" in Validation Rule and it
will recognize your Validation Text.
 
J

Jeff Boyce

Tru

I made the (erroneous) assumption that you HAD to have this field required.
Glad you found a solution!

Jeff
 

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