S
Scott Stubbs
Hi,
I have a form that allows the user to enter comments in a bound text box.
The bound field name is called StaffComments. In SQL Server 2000 Desktop
Edition, the column is defined as text and nulls are not allowed.
However, my validation rule does not appear to be evaluating when a user
attempts to add a new record. If they do not enter anything in the text box
and attempt to save the new record, Access returns the SQL Server error
message that it can not insert due to a NULL column value.
Fundamentally, that's good. SQL Server is enforcing the rule but my concern
is the fact that my ValidationRule expression is not evaluating and
displaying my ValidationText message.
If the user where to enter some text and then delete that text, the value of
the field (or text box) would no longer be null and contain an empty string.
In this case, my ValidationRule expression does evaluate and the user gets
the ValidationText message that I defined.
I've tried various combinations of expressions for the ValidationRule and
have alternated the requirement of NOT NULL in the table definition with
consistent results. In summary, it appears that if the control has never
received any input from the user on a new record and that field can not be
null, the ValidationRule for the control never evaluates.
Here is what my ValidationRule property is set to for now:
<> 0 And Is Not Null
The ValidationText property is set to my own error message text.
I'm having a hard time getting my brain around this one. If anyone has seen
this before and has a solution or even an explanation why, I sure would be
grateful for a response.
Best regards,
Scott S.
I have a form that allows the user to enter comments in a bound text box.
The bound field name is called StaffComments. In SQL Server 2000 Desktop
Edition, the column is defined as text and nulls are not allowed.
However, my validation rule does not appear to be evaluating when a user
attempts to add a new record. If they do not enter anything in the text box
and attempt to save the new record, Access returns the SQL Server error
message that it can not insert due to a NULL column value.
Fundamentally, that's good. SQL Server is enforcing the rule but my concern
is the fact that my ValidationRule expression is not evaluating and
displaying my ValidationText message.
If the user where to enter some text and then delete that text, the value of
the field (or text box) would no longer be null and contain an empty string.
In this case, my ValidationRule expression does evaluate and the user gets
the ValidationText message that I defined.
I've tried various combinations of expressions for the ValidationRule and
have alternated the requirement of NOT NULL in the table definition with
consistent results. In summary, it appears that if the control has never
received any input from the user on a new record and that field can not be
null, the ValidationRule for the control never evaluates.
Here is what my ValidationRule property is set to for now:
<> 0 And Is Not Null
The ValidationText property is set to my own error message text.
I'm having a hard time getting my brain around this one. If anyone has seen
this before and has a solution or even an explanation why, I sure would be
grateful for a response.
Best regards,
Scott S.