By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,498 Members | 1,564 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,498 IT Pros & Developers. It's quick & easy.

Subform creates duplicate records in Main Form

P: n/a
I'm missing the mistake.

I have a MainForm called frmResources.
I have a Second Form and related table called frmFootnotes. I am trying to
use it as a subform to the main form appearing in a tabctl in the main form.

The two are related with a one-to-many relationship. The PrimaryID field in
Resources is related to a non-primary field in Footnotes. At least that is
where it currently is. I've tried every combination I can think of and even
stood on my head a couple of times to see if that would make it work
correctly. No matter what, I get duplicate records in Resources when I add
more than 1 Footnote in the Subform (using a continuous form for the
Footnote Sub).

A wierd thing is that other related tables/forms with the same format work
just fine, one is in the main part of the form and one is under a separate
tab.

The solution is no doubt simple, elegant and hopefully correct. Any help
would be greatly appreciated.

CharlesL
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
How are the two tables related? Does the child table (FootNotes) have
a field of the same type as the primary key in the parent table
(Resources)?

Sounds like that could be the problem.

For example, this is wrong:

/*bastardized SQL DDL */
CREATE TABLE Resource(
ResourceID Autonumber,
Title Text (Primary Key)
)

CREATE TABLE Reference(
ReferenceID Autonumber,
FromResourceID Long Integer,
....
FOREIGN KEY FromResourceID REFERENCES Resource(ResourceID)
ON DELETE CASCADE

then if you set the relationships in the relationships window, the rest
should take care of itself. What is the type of relationship between
the two tables? If it's "indeterminate" or "one-to-one", then that's
your problem.

Hope that helps a little.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.