P
Paul Ponzelli
I would like to require a field to have a non-null value, but I need to do
this at form level instead of setting the Required property of the field to
"Yes" in the table. The reason for not wanting to do this in the table is
that not all users will be able to see this field in their forms. One
option that's available would be to move these fields into a separate table
that's related to the main table by a one-to-one relationship, and thus keep
the validation rule in the table, but I'm trying to avoid that step.
So I've tried entering these expressions in the 'Validation Rule' property
setting of the form control:
Is Not Null, and
Len(Nz([MyField]))>0
But neither of these expressions prevents a user from creating a new record
while leaving "MyField" null. I did notice, however, that if I try to
delete a value that already exists in that field, it runs the validation
error. But I need it to prevent Access from saving a new record that has
only a null value in MyField.
Is there an expression I can put in the Validation Rule property of the form
that will accomplish this?
Thanks in advance,
Paul
this at form level instead of setting the Required property of the field to
"Yes" in the table. The reason for not wanting to do this in the table is
that not all users will be able to see this field in their forms. One
option that's available would be to move these fields into a separate table
that's related to the main table by a one-to-one relationship, and thus keep
the validation rule in the table, but I'm trying to avoid that step.
So I've tried entering these expressions in the 'Validation Rule' property
setting of the form control:
Is Not Null, and
Len(Nz([MyField]))>0
But neither of these expressions prevents a user from creating a new record
while leaving "MyField" null. I did notice, however, that if I try to
delete a value that already exists in that field, it runs the validation
error. But I need it to prevent Access from saving a new record that has
only a null value in MyField.
Is there an expression I can put in the Validation Rule property of the form
that will accomplish this?
Thanks in advance,
Paul