Required fields?

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

I have created a form with combo boxes that retrieve
values for several foreign keys.

When I use the form, I am required to complete entries
for all fields using foreign keys. If I try to save an
incomplete record (maybe I don't have all of the eq
information yet), I get a dialog that reads: "You cannot
add or change a record because a related record is
required in Table 'tablename'".

How can I modify the form (or other properties) and avoid
this situation?
 
In the database window, select the table that contains these foreign keys,
and open it in design view.

Select a foreign key field. In the lower pane, delete anything from the
Default Value property. Typically foreign keys are Number type, and Access
assigns zero as the default value. When you try to create a new record, the
zero matches nothing, and so the record cannot be saved.

While you are there, check if that Required property is set to No if you do
not intend the foreign key to be required.
 
Worked like a charm. Thanks a million!
-----Original Message-----
In the database window, select the table that contains these foreign keys,
and open it in design view.

Select a foreign key field. In the lower pane, delete anything from the
Default Value property. Typically foreign keys are Number type, and Access
assigns zero as the default value. When you try to create a new record, the
zero matches nothing, and so the record cannot be saved.

While you are there, check if that Required property is set to No if you do
not intend the foreign key to be required.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.





.
 
Back
Top