How to validate a field which will not allow null values.

G

Guest

I have validated my feilds in the design view of the order table as follows :

Field Name = Ordered Qty
Validation Rule >=1
Validation Test Enter Qty
Required yes

But, even then, the feild still allows null values when I enter the same
using a Form. Please help for both Text fields as well as for Number fields.
Thanks
 
A

Allen Browne

Setting the Required property should be enough.

If you set the Required property to Yes for the field in the table, there is
no way Access can save a null through your form. (There might be old records
in the table where the field was Null before you set the Required property,
but any edits or new records will not save.)

For Text and Memo fields, I suggest you also set the field's Allow Zero
Length to No in the table. This will prevent zero-length strings as well as
nulls.
 

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