Required fields?

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?
 
A

Allen Browne

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.
 
S

Scott

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.





.
 

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