'You cannot assign a value to this object'

Hello. I get the above message when I try to enter data into a sub form. The main form 'Referral' is based on a table with the same name and the subform 'youngperson' is also based on a table with that name. the relationship of young person to referral is one to many.If i enter some data into the referral table first and then try to enter data into the subform , i get the message 'you cannot add or change ....because a related record is required in young person'
What am I doing wrong ?
Thanks in advance.
barnett100Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Are your tables properly related? The "youngperson" table should store the ID value of the "referral" table. The error sounds like you've got a relationship problem, since your youngperson table shouldn't depend on itself.

Are your Master/Child links set correctly for the subform? The error is just Access telling you that you're trying to enter an orphaned record, and typically this comes about when those links aren't set correctly. Your Master link would be the ID of the Referral table, and your Child link would be the field in "youngperson" where you store the value of Referral.ID.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
barnett100Author Commented:
Thanks. Im sure you are right. I thought that in a one to many relationship the pk of the one ended up as the fk of the many., thus creating the link. Ive obviously got a bit mixed upi and will try reorganising my relationships. Thanks
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
It does ... if your Referrals is the "one" and the YoungPerson is the "Many", you'd store the value of Referrals.IDField in YoungPerson.YourForeignKeyField
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.