Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

required field in table isn't required? 1

Status
Not open for further replies.

Beren1h

Technical User
Jul 19, 2001
104
0
0
US
I have a database that has a table with a field that is listed as required.

However, when a record is input with the form that is bound to this table it is possible to save the record without any information in this field.

The control on the form is a combo box with two columns (an ID number and description) where the user selects a number based on the description.

This makes no sense to me, does it to anyone else?

 
It's a number field in the table. It doesn't have the 'Allow Zero Length' option.

Any other ideas?
 
Hi!

Does it have a default value of zero? If it does then I think access considers that as being filled in. Maybe you could set a validation rule for the field.

hth
Jeff Bridgham
 
Bingo!

That's exactly what is happening.

Thanks to both of you for helping...
 
Beren1h,
Several things, first if there is a default value set then the record will have that default value. If the required field is the primary key, and "Nulls" are allowed then you will be allowed 1 null as a unique value, meaning that the second time you try to enter a null value you will generate an error, not the first. The best solution is to validate your data before you save it, there are many ways of doing this through code depending upon your application.

hunter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top