468,765 Members | 1,698 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

Subform creates duplicate records in Main Form

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

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

Nov 13 '05 #1
1 2600
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

Sounds like that could be the problem.

For example, this is wrong:

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

ReferenceID Autonumber,
FromResourceID Long Integer,
FOREIGN KEY FromResourceID REFERENCES Resource(ResourceID)

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.

Similar topics

6 posts views Thread by Ray | last post: by
14 posts views Thread by Kurt | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.