How do I populate my primary key field within my subform?

I have a subform (ProblemList) that constist of 2 fields: ICD9_Code & ICD9_Description
Can someone please tell me how to populate field tbI_OfficeVisits_CD9.ICD9_Code within my subform?   I am pulling in the Description field just fine.  Please see my attachment and note subform Problem List.

My syntax
SELECT [tbl_OfficeVisits_ICD9].[ICD9_Code], [tbl_ICD9].[Description], [tbl_OfficeVisits_ICD9].[Patient_id] FROM tbl_ICD9 INNER JOIN tbl_OfficeVisits_ICD9 ON tbl_ICD9.ICD9_Code=tbl_OfficeVisits_ICD9.ICD9_Code;
Who is Participating?
donvike1Connect With a Mentor Author Commented:
I was able to resolve this by pointing the Source Object field to a query  - query is based on tbl_OfficeVisits_ICD9 fields OCD9_Code and Description.  I got my results - see my attachment.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Have you set the Master and Child linkfields for the subform to the correct fields? If you do, then Access will automatically save the parent value in the child record.

However, generally you would include only the "ID" field when relating records, and not the description. Can you explain why you're doing both?
donvike1Author Commented:
I need both fields to show up in my Problem List form as in the attachment.
donvike1Author Commented:
Ok, I checked my Master/Child fields
Link Master Fields = Patient_id
Link Child Field = Patient_id

How can I set this to ICD9_Code?
donvike1Author Commented:
I was able to resolved the issue at hand.
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.

All Courses

From novice to tech pro — start learning today.