• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 526
  • Last Modified:

Error linking subform child and master fields

Hi everyone,

Hope someone can help me with this problem I am having linking a form
to a subform with link child fields and link master fields.

Basically I have a form: "pupils details"
My form has a subform:   "pupils_sub"  (though it's control name is "child300").

Each form is based on a different table but both tables
have a longint field called "link_id".

In the properties of "child300" I have set the child and
master fields to "parents.link_id" and "pupils.link_id".

This means that each pupil's details record on the main form
will bring up the corresponding parent's details on the subform.

Everything works fine so long as there is a corresponding
parent record. But sometimes we might have added a new pupil
record and not got around to adding the parent record so Access
can't link the Child and Master link fields.

Then an error appears which says:

"the linkmaster fields property setting has produced this
error: "the object doesn't contain the automation object Pupils".

Question 1.  How do I get rid of this annoying message?

Question 2. If we've just added a new pupil record on the
mainform, how do I get Access to jump to the subform and create
a new record in the "Parents" table and set it's "link_id" to
the "link_id" of the current pupil record in the mainform?

Should I use some sort of VB code or should this be fixed with
SQL or macros or something?

PS: I am using Access 97 for this project.

Thanks for any help!..
  • 3
  • 2
1 Solution
The linkChild and LinkMaster properties should not be qualified by the table name. it is the name of the textbox on the master and sub forms. The ControlName is ofter the same but as you have seen with the subform then this is not always the case.

If the linkChild / LinkMaster are set correctly then the link child field will default to the link master value.

Cheers, Andrew
kcs_tecAuthor Commented:
Sorry to be so late commenting here...

Thanks Andrew, for your comment, but it wasn't quite
what I had in mind for a solution.

I have actually worked out a possible solution myself
so I guess this question might as well be closed. Any
EE admins reading this - please can I have the points
back if possible since nobody submitted a solution.


 - S.
Can you please post here the solution you found befor posting a zero points question in Community Support to get the points refunded.

Cheers, Andrew
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

kcs_tecAuthor Commented:
Thanks for the comment TextReport.

I solved this problem by creating a few lines of
VB code which ran when one of the fields in the
parent subform got the focus. The code got the link_id
from the main pupil form and imported it into the
corresponding "link_id" field on the parent form. This
pretty much fixed the problem.

Hope I get the points back on this question so I can
put them into some other questions. It's strange that no-one had a solution for this, it's the first time on
EE that I've not had an answer.
points refunded and question PAQ'ed

CS Moderator
Sorry I have been away, thanks for clarifying the problem and best wishes. Andrew

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now