Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Side by side subforms help

Status
Not open for further replies.

TCARPENTER

Programmer
Mar 11, 2002
766
US
I have a form containing two sub-forms which I need linked to each other (side by side) and they are based on the following tables:

ProjectTable:
Project_Recnum - Autonumber - PK
Project_Descr - Text

Milestone_Table:
Milestone_Recnum - Autonumber - Unique Identifier
Milestone_Descr - Text - PK

Milestone_Resources:
Milestone_Res_Recnum - Autonumber - Unique Identifier
Milestone_Res_Descr - Text - PK

ProjectMilestones:
ProjectMilestones_Recnum - Autonumber - Unique Identifier
ProjectRecnum - FPK
Milestone_Recnum - FPK
ProjectMilestones_Due - Date
ProjectMilestones_Recd - Date
Milestone_Res_Recnum - FK
ProjectMilestones_Notes - Memo

The main form contains the project information, and in one sub-form, I want just these fields:

Milestone_Recnum
ProjectMilestones_Due
ProjectMilestones_Recd
ProjectMilestones_Notes

In a second sub form, to the right of the first, I want just one field:
Milestone_Res_Recnum

What I was hoping to acheive was a data sheet view of each subform and as the user scrolled through the list of milestones, they could add/edit/view the responsible party or parties for each particular milestone, I have linked the forms sucessfully (sort of) but can't add more than one record to the form on the right without an error. I do have relationships set up for the tables - what am I missing?

Todd
 
You may have already checked this out - If project milestones table has been set as the primary table in the relationship with milestone_resources and if referential integrity has been set, you cannot add records to milestone_resources (using the 2nd subform, on the right) without a matching record in projectmilestones.
 
Hi Ashank4vba,

I can add records - just one though and then I get an error. Thanks though!
 
The ForeignKeys should allow duplicates in one to many relationship

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

That's what I thought too, but after I add one, when I try to add another, I get an error - maybe this would be better with a list box?

Todd
 

Just as an experiment, try unrelating the tables, so that the relationship is controlled by the subform Master/Child links, see if it makes a difference.

You may have a circular relationship somewhere or something.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top