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

Parent and Sub Form linking

Experts, I thought I knew how to do this but seems something is wrong.  

In the attached, I want to link on [ID] (Master) and [ID2] (Child) and I have it setup this way as you can see in the properties sheet. However, it seems it is linking on [ProjectID] (Master) and [ProjID] (Child)

I am using 2007.

thank you.
0
pdvsa
Asked:
pdvsa
  • 4
  • 3
  • 3
  • +1
1 Solution
 
Helen FeddemaCommented:
Enter the appropriate field names in the LinkChildFields (subform) and LinkMasterFields (main form) properties of the subform.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You didn't include an attachment, but to do so you can click on the build button in the "link master field" or the "link child field" property. This will open the dialog, and you can select the fields you'll use to link the items together.

linksEE-LinkFields.png
0
 
pdvsaAuthor Commented:
crap.  I didnt click the "attach" button.  Sorry.  
See if you can notice the error...thanks.  (was busy this am with my "real" job)

EE.accdb
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
pdvsaAuthor Commented:
I am not linking on [ProjID] but [ID] (the blue field).
0
 
mbizupCommented:
Your form/subform setup with the subform in the footer of a continuous form is a little unconventional, but it should work!

The textbox containing Project ID is named "ID", and I think that is the source of your trouble.

As the others have said - set up your master/child links:

Master:  ID
Child: ID2

Then, give your textboxes in the main form proper names:

txtID for the ID field
txtProjectID for the projectID field

That will resolve any confusion over field/textbox names, and seems to work for me in your sample.
0
 
pdvsaAuthor Commented:
Thank you mbizup.... How else cld i comstruct subform?  I might have 30 rows of data and i thgt that putting in footer wld be best?
0
 
mbizupCommented:
Sorry I didn't mean to imply that I thought anything was wrong with it.  On the contrary, it looked like a great way to handle it.  The layout is appealing and seems to work very well.   I've just never seen a subform set up that way before.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
It seemed to be working for me, assuming that you wanted to show the records in the subform for selected record in the mainform. There was only one record (with a value of 19) in the table sourcing the subform, and it seemed to show data correctly. Once your mainform records moved OFF that 19 value, the subform was blank (as it should be) - so I'm still not sure exactly what it is supposed to be showing, or what the "error" is.

In the future, I'd suggest that you clearly state exactly what the problem is. In this case, the Master/Child link fields seem to be okay, so it's not exactly clear what the trouble is (at least to me).
0
 
mbizupCommented:
Scott,

He's mentioned it incorrectly linking on the ProjectID field when it should be linking the ID field in the mainform with the ID2 field in the subform.

In that original sample, 19 is the projectID.  When the user clicks through the mainform records it should be displaying 47, 48, 56, etc corresponding to the records in the mainform.

The master/child links LOOK right in the original sample.  I don't know why but what is actually happening is that the link seems to be prioritizing the textbox name over the field name.   I'm not sure if Access always behaves that way or of this form layout is affecting it.

The textbox containing the projectID field in the main form is poorly named  "ID" which is also the name of the field that it *should* be linking to, and if you rename it to txtProjectID (or anything else), the link will correct itself to use the Field name instead of the textbox name.
0
 
pdvsaAuthor Commented:
the control names were the issue.  I put ''txt''  in front of them (like I should have in the first place).  thank you for the help.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I'm just confused, so I'll be quiet and go away :)
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

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