How to update child records using a sub-form

R

Rich

Hello,

I have a form with a tab control. the tab control has multiple tabs with a
sub-form on each tab. The data is all computer related and PK on the parent
and sub-forms is a computer hostname. A child table, "HardwareConfig" for
example has CPU info, disk info, etc. The HardwareConfig table is
pre-populated with the hostname. Whenever I try to UPDATE the child table
using the form, I get an error telling me that the udpate would result in a
duplicate record (duplicate hostname) which is not allowed. Hostname is
indexed, but no duplicates.

How can I update the child table using the sub-form, or how do I tell Access
that this is an update, and not a new record?

Thanks,
Rich
 
M

Mark A. Sam

Rich,

You said, "Hostname is indexed, but no duplicates."

If Hostname is the LinkChildField (on the subtable) you need to allow
duplicates, unless you want a One to One relationship, there is no need to
disallow duplicates on the subtable. That is what is causing the problem.

God Bless,

Mark A. Sam
 

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