cascade update/delete question

J

Jamie

I have two tables with a one to one relationship with
cascade update/delete checked. On the main form I have a
button that is linked to a popup form that uses the second
table. Everything is fine, so long I edit a current
record, but when adding a new employee the related field
in the second table is not added. I thought the
update/delete is suppose to handle this? The second table
has the same field as the main table for the primary field.

Jamie
 
T

Terry

Hi Jamie,
The popup form has no link to the recordset in the main form. You would be
best using a mainform/subform linked on the primary keys, then you would
find it should work.
Regards
 
A

Allen Browne

Hi Jamie.

The cascading relationships do not cause a new record to be added to the
related table. You can use the AfterInsert event of your form to
automatically insert the other record as well, by executing an Append query
statement generated in code.

However, that won't solve the cause of your problem. If you have this many
fields, and are using another table with a one-to-one relation to get more
fields, there is a serious problem with the data structure. You need to
create a series of tables with one-to-many relations, instead of these
monster tables. There is a built-in tool that may help you to analyze the
table and suggest an alternative structure:
Tools | Analyze | Table
 

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