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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add Record for all related tables

Status
Not open for further replies.

kronar30

Programmer
Sep 8, 2004
74
US
I have a form and subform. When user wishes to add a new job record how do I add all the records to related tables?
 
Make sure your relationships are all setup correctly, then set them to enforce referential integrity and cascade updates.

Just make sure that you form/subform provide all the required (key) fields in all the related tables to allow new records to be added.

CMP
 
How are ya kronar30 . . . . .

Sounds like your form/subform are not bound to the tables. Is this correct?

If so why not bind them?

Calvin.gif
See Ya! . . . . . .
 
And provided the RelationShips are properly set, simply follow the subform wizard.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I went to Edit Relationship
All tables relate to the JB_Jobs table and the JB_JobBidNo field. The JBO_JobOverheads table relationship is a one to one relationship.
However when I try to set the enforce referential integrety I get an error "No unique index found for the referential field of the primary table"
It lets me set it for the one to many table!
help
 
For a one to one relationship you must have JobBidNo as Primary Key (or at least unique index) in both tables.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The overheads table consists of about 6 records for each job record from the main table. So JobBidNo can't be Primary Key in the one to many relationship.
I think the form and sub-forms are bound to the tables, how would I tell?
Any more ideas? Thanks
 
kronar30 said:
[blue] . . . The JBO_JobOverheads table relationship is a one to one relationship . . .
The overheads table consists of about 6 records for each job record from the main table.[/blue]
[blue]This is a one to many relationship![/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top