populating juncture table?

kdirvin

Registered User.
Local time
Today, 04:07
Joined
Feb 13, 2011
Messages
41
I am using Access 2007 and have created a juncture table to accommodate a many-to-many relationship between projects and checks in my database. The juncture table contains foreign keys of both the ProjectID PK from tbl_Projects and the CheckID PK from tbl_Checks.
I use a data-entry form to populate tbl_Projects. I thought that when I entered projects through this form, the project FKs automatically populated in the juncture table as well. That is not the case. The projects do not enter the juncture table until I populate their related checks through a subform, hereby linking them.
Is it possible for the Project FKs to automatically populate in the juncture table? I ask because I have a report that uses my juncture table and queries with outer joins to display which projects do not yet have checks associated with them.
Thank you always!
 
The projects do not enter the juncture table until I populate their related checks through a subform, hereby linking them.

That is expected behavior (that's the way it should to work). The FK value is populated by the Master/Child relationship between the main form and sub form. If a project has no checks associated with it, then it should have no records in the junction table.

I ask because I have a report that uses my juncture table and queries with outer joins to display which projects do not yet have checks associated with them.

This could be done with a simple sub query in the Where clause of the Projects query, like the following ;

Select ProjectID, ProjectName
From tblProjects
Where ProjectID Not In(Select ProjectID From tblTheJunctionTable)
 
this fixed my problem perfectly. thank you!
 

Users who are viewing this thread

Back
Top Bottom