Error linking subform child and master fields

Posted on 2003-03-23
Medium Priority
Last Modified: 2008-03-10
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!..
Question by:kcs_tec
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 28

Expert Comment

ID: 8191665
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

Author Comment

ID: 8309494
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.
LVL 28

Expert Comment

ID: 8309632
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.


Author Comment

ID: 8375640
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.

Accepted Solution

DigitalXtreme earned 0 total points
ID: 8377983
points refunded and question PAQ'ed

CS Moderator
LVL 28

Expert Comment

ID: 8406042
Sorry I have been away, thanks for clarifying the problem and best wishes. Andrew

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question