Why won't the validation message show?

G

Guest

I have a form in which I have a variable field to which I set the default to
Null. The Validation Rule I entered is Is Not Null. I also entered text for
the Validation text.

The field is unbound for data entry and is bound to a required data field on
a tabel for modification. The field is also Enabled.

The Validation Text does not show when the field loses focus. How do I
correct this?

Thanks!
 
T

Tim Ferguson

I have a form in which I have a variable field to which I set the
default to Null. The Validation Rule I entered is Is Not Null. I
also entered text for the Validation text.

If it's required, then it's probably better to give it a non-null
DefaultValue isn't it?
The field is unbound for data entry and is bound to a required data
field on a tabel for modification. The field is also Enabled.

I don't understand this. Is the control bound to a controlsource or not?
The Validation Text does not show when the field loses focus. How do
I correct this?

The ValidationRule will not be checked unless the contents are dirtied
(i.e. changed by the user). In your case, the contents are initialised to
Null and not subsequently changed, so they won't be looked at. The
BeforeUpdate and AfterUpdate events won't be triggered either, but the
LostFocus event will be, assuming the user ever enters the control in the
first place.

The table-field-ValidationRule _will_ be tested, however, as soon as the
new record is saved -- if it's a required field then you'll get a DB engine
error and a FormError event. That is why it's sensible to use field-level
default values on non-nullable fields.

Hope that helps


Tim F
 

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

Similar Threads


Top